home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 15 / BBS in a box XV-2.iso / Files II / Prog / U-Z / VideoToolbox 4.95.sit / VideoToolbox / VideoToolboxSources / GDOpenWindow.c < prev    next >
MacBinary  |  1995-04-12  |  19.0 KB  |  [TEXT/MMCC]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, Wed Apr 12 00:08:46 1995, modified Wed Apr 12 00:08:46 1995, creator 'MMCC', type ASCII, 18122 bytes "GDOpenWindow.c" , at 0x474a 1040 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[MMCC]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0e 47 44 4f 70 65 6e | 57 69 6e 64 6f 77 2e 63 |..GDOpen|Window.c|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 4d 43 | 43 00 00 00 00 00 00 00 |.TEXTMMC|C.......|
|00000050| 00 00 00 00 00 46 ca 00 | 00 04 10 ab b1 02 ce ab |.....F..|........|
|00000060| b1 02 ce 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 f2 46 00 00 |........|.....F..|
|00000080| 2f 2a 20 47 44 4f 70 65 | 6e 57 69 6e 64 6f 77 2e |/* GDOpe|nWindow.|
|00000090| 63 0d 43 6f 70 79 72 69 | 67 68 74 20 a9 20 31 39 |c.Copyri|ght . 19|
|000000a0| 38 39 2d 31 39 39 35 20 | 44 65 6e 69 73 20 47 2e |89-1995 |Denis G.|
|000000b0| 20 50 65 6c 6c 69 0d 0d | 45 58 41 4d 50 4c 45 3a | Pelli..|EXAMPLE:|
|000000c0| 0d 0d 4f 70 65 6e 20 79 | 6f 75 72 20 77 69 6e 64 |..Open y|our wind|
|000000d0| 6f 77 20 62 79 20 73 61 | 79 69 6e 67 3a 0d 09 77 |ow by sa|ying:..w|
|000000e0| 69 6e 64 6f 77 3d 47 44 | 4f 70 65 6e 57 69 6e 64 |indow=GD|OpenWind|
|000000f0| 6f 77 28 64 65 76 69 63 | 65 29 3b 0d 57 68 65 6e |ow(devic|e);.When|
|00000100| 20 79 6f 75 27 72 65 20 | 74 68 72 6f 75 67 68 20 | you're |through |
|00000110| 77 69 74 68 20 74 68 65 | 20 77 69 6e 64 6f 77 2c |with the| window,|
|00000120| 20 67 65 74 20 72 69 64 | 20 6f 66 20 69 74 20 62 | get rid| of it b|
|00000130| 79 20 63 61 6c 6c 69 6e | 67 3a 0d 09 47 44 44 69 |y callin|g:..GDDi|
|00000140| 73 70 6f 73 65 57 69 6e | 64 6f 77 28 77 69 6e 64 |sposeWin|dow(wind|
|00000150| 6f 77 29 3b 0d 42 65 73 | 69 64 65 73 20 63 6c 6f |ow);.Bes|ides clo|
|00000160| 73 69 6e 67 20 74 68 65 | 20 77 69 6e 64 6f 77 20 |sing the| window |
|00000170| 61 6e 64 20 64 69 73 70 | 6f 73 69 6e 67 20 6f 66 |and disp|osing of|
|00000180| 20 74 68 65 20 61 6c 6c | 6f 63 61 74 65 64 20 6d | the all|ocated m|
|00000190| 65 6d 6f 72 79 20 73 74 | 72 75 63 74 75 72 65 73 |emory st|ructures|
|000001a0| 0d 47 44 44 69 73 70 6f | 73 65 57 69 6e 64 6f 77 |.GDDispo|seWindow|
|000001b0| 20 61 6c 73 6f 20 72 65 | 73 74 6f 72 65 73 20 74 | also re|stores t|
|000001c0| 68 65 20 64 65 76 69 63 | 65 27 73 20 63 6f 6c 6f |he devic|e's colo|
|000001d0| 72 20 74 61 62 6c 65 20 | 61 6e 64 20 63 6c 75 74 |r table |and clut|
|000001e0| 2e 0d 0d 53 55 4d 4d 41 | 52 59 3a 0d 0d 77 69 6e |...SUMMA|RY:..win|
|000001f0| 64 6f 77 3d 47 44 4f 70 | 65 6e 57 69 6e 64 6f 77 |dow=GDOp|enWindow|
|00000200| 28 64 65 76 69 63 65 29 | 20 6f 70 65 6e 73 20 61 |(device)| opens a|
|00000210| 20 66 75 6c 6c 2d 73 63 | 72 65 65 6e 20 77 69 6e | full-sc|reen win|
|00000220| 64 6f 77 20 6f 6e 20 74 | 68 65 20 73 70 65 63 69 |dow on t|he speci|
|00000230| 66 69 65 64 20 73 63 72 | 65 65 6e 2c 0d 63 61 6c |fied scr|een,.cal|
|00000240| 6c 20 47 44 47 72 61 79 | 43 6f 6c 6f 72 54 61 62 |l GDGray|ColorTab|
|00000250| 6c 65 28 64 65 76 69 63 | 65 29 20 77 68 69 63 68 |le(devic|e) which|
|00000260| 20 67 69 76 65 73 20 74 | 68 65 20 64 65 76 69 63 | gives t|he devic|
|00000270| 65 20 61 20 73 74 61 6e | 64 61 72 64 20 67 72 61 |e a stan|dard gra|
|00000280| 79 20 63 6f 6c 6f 72 20 | 74 61 62 6c 65 0d 28 69 |y color |table.(i|
|00000290| 66 20 69 74 20 64 6f 65 | 73 6e 27 74 20 61 6c 72 |f it doe|sn't alr|
|000002a0| 65 61 64 79 29 2c 20 61 | 6e 64 20 63 61 6c 6c 73 |eady), a|nd calls|
|000002b0| 20 41 64 64 45 78 70 6c | 69 63 69 74 50 61 6c 65 | AddExpl|icitPale|
|000002c0| 74 74 65 28 77 69 6e 64 | 6f 77 29 2c 20 77 68 69 |tte(wind|ow), whi|
|000002d0| 63 68 20 61 6c 6c 6f 77 | 73 20 79 6f 75 0d 74 6f |ch allow|s you.to|
|000002e0| 20 73 70 65 63 69 66 79 | 20 63 6f 6c 6f 72 73 20 | specify| colors |
|000002f0| 74 6f 20 70 61 69 6e 74 | 20 77 69 74 68 20 62 79 |to paint| with by|
|00000300| 20 75 73 69 6e 67 20 50 | 6d 46 6f 72 65 43 6f 6c | using P|mForeCol|
|00000310| 6f 72 28 29 20 61 6e 64 | 20 50 6d 42 61 63 6b 43 |or() and| PmBackC|
|00000320| 6f 6c 6f 72 28 29 2e 20 | 54 68 65 0d 77 69 6e 64 |olor(). |The.wind|
|00000330| 6f 77 20 74 72 75 6c 79 | 20 66 69 6c 6c 73 20 74 |ow truly| fills t|
|00000340| 68 65 20 73 63 72 65 65 | 6e 3a 20 61 6e 79 20 72 |he scree|n: any r|
|00000350| 6f 75 6e 64 65 64 20 63 | 6f 72 6e 65 72 73 20 61 |ounded c|orners a|
|00000360| 72 65 20 6d 61 64 65 20 | 73 71 75 61 72 65 20 61 |re made |square a|
|00000370| 6e 64 20 69 66 20 74 68 | 65 0d 77 69 6e 64 6f 77 |nd if th|e.window|
|00000380| 20 69 73 20 6f 6e 20 74 | 68 65 20 6d 61 69 6e 20 | is on t|he main |
|00000390| 73 63 72 65 65 6e 20 74 | 68 65 6e 20 74 68 65 20 |screen t|hen the |
|000003a0| 4d 65 6e 75 20 42 61 72 | 20 69 73 20 68 69 64 64 |Menu Bar| is hidd|
|000003b0| 65 6e 2e 20 54 68 65 20 | 73 63 72 65 65 6e 20 6f |en. The |screen o|
|000003c0| 63 63 75 70 69 65 73 0d | 74 68 65 20 63 6f 6e 74 |ccupies.|the cont|
|000003d0| 65 6e 74 20 61 72 65 61 | 20 6f 66 20 74 68 65 20 |ent area| of the |
|000003e0| 77 69 6e 64 6f 77 3b 20 | 74 68 65 20 77 69 6e 64 |window; |the wind|
|000003f0| 6f 77 27 73 20 66 72 61 | 6d 65 20 28 6f 6e 65 2d |ow's fra|me (one-|
|00000400| 70 69 78 65 6c 20 62 6c | 61 63 6b 20 6c 69 6e 65 |pixel bl|ack line|
|00000410| 20 62 6f 72 64 65 72 0d | 61 6e 64 20 74 69 74 6c | border.|and titl|
|00000420| 65 20 62 61 72 29 20 69 | 73 20 6f 66 66 20 74 68 |e bar) i|s off th|
|00000430| 61 74 20 73 63 72 65 65 | 6e 2c 20 62 75 74 20 77 |at scree|n, but w|
|00000440| 69 6c 6c 20 61 70 70 65 | 61 72 20 6f 6e 20 6f 74 |ill appe|ar on ot|
|00000450| 68 65 72 20 73 63 72 65 | 65 6e 73 20 74 68 61 74 |her scre|ens that|
|00000460| 20 66 6f 72 6d 0d 63 6f | 6e 74 69 67 75 6f 75 73 | form.co|ntiguous|
|00000470| 20 70 61 72 74 73 20 6f | 66 20 79 6f 75 72 20 64 | parts o|f your d|
|00000480| 65 73 6b 74 6f 70 2e 20 | 54 68 65 20 65 6c 65 67 |esktop. |The eleg|
|00000490| 61 6e 74 20 73 6f 6c 75 | 74 69 6f 6e 20 74 6f 20 |ant solu|tion to |
|000004a0| 74 68 69 73 2c 20 77 68 | 69 63 68 20 70 65 72 68 |this, wh|ich perh|
|000004b0| 61 70 73 0d 73 6f 6d 65 | 6f 6e 65 20 77 69 6c 6c |aps.some|one will|
|000004c0| 20 69 6d 70 6c 65 6d 65 | 6e 74 2c 20 77 6f 75 6c | impleme|nt, woul|
|000004d0| 64 20 62 65 20 74 6f 20 | 64 65 66 69 6e 65 20 61 |d be to |define a|
|000004e0| 20 6e 65 77 20 77 69 6e | 64 6f 77 20 74 79 70 65 | new win|dow type|
|000004f0| 20 74 68 61 74 20 68 61 | 73 20 6e 6f 20 66 72 61 | that ha|s no fra|
|00000500| 6d 65 2e 0d 0d 47 44 44 | 69 73 70 6f 73 65 57 69 |me...GDD|isposeWi|
|00000510| 6e 64 6f 77 28 77 69 6e | 64 6f 77 29 20 63 6c 6f |ndow(win|dow) clo|
|00000520| 73 65 73 20 61 6e 64 20 | 64 69 73 63 61 72 64 73 |ses and |discards|
|00000530| 20 61 20 63 6f 6c 6f 72 | 20 77 69 6e 64 6f 77 2c | a color| window,|
|00000540| 20 64 69 73 70 6f 73 69 | 6e 67 20 6f 66 20 61 6e | disposi|ng of an|
|00000550| 79 0d 70 61 6c 65 74 74 | 65 20 6f 72 20 63 6f 6c |y.palett|e or col|
|00000560| 6f 72 20 74 61 62 6c 65 | 2c 20 67 65 6e 65 72 61 |or table|, genera|
|00000570| 6c 6c 79 20 75 6e 64 6f | 69 6e 67 20 77 68 61 74 |lly undo|ing what|
|00000580| 65 76 65 72 20 47 44 4f | 70 65 6e 57 69 6e 64 6f |ever GDO|penWindo|
|00000590| 77 31 20 64 69 64 2e 0d | 0d 41 64 64 45 78 70 6c |w1 did..|.AddExpl|
|000005a0| 69 63 69 74 50 61 6c 65 | 74 74 65 28 77 69 6e 64 |icitPale|tte(wind|
|000005b0| 6f 77 29 20 61 64 64 73 | 20 61 20 70 61 6c 65 74 |ow) adds| a palet|
|000005c0| 74 65 20 74 6f 20 61 20 | 63 6f 6c 6f 72 20 77 69 |te to a |color wi|
|000005d0| 6e 64 6f 77 20 6f 72 20 | 47 57 6f 72 6c 64 20 77 |ndow or |GWorld w|
|000005e0| 69 74 68 20 61 6c 6c 0d | 74 68 65 20 63 6f 6c 6f |ith all.|the colo|
|000005f0| 72 73 20 6d 61 72 6b 65 | 64 20 61 73 20 70 6d 45 |rs marke|d as pmE|
|00000600| 78 70 6c 69 63 69 74 2e | 20 54 68 69 73 20 61 6c |xplicit.| This al|
|00000610| 6c 6f 77 73 20 79 6f 75 | 20 74 6f 20 75 73 65 20 |lows you| to use |
|00000620| 50 6d 46 6f 72 65 43 6f | 6c 6f 72 28 29 20 61 6e |PmForeCo|lor() an|
|00000630| 64 0d 50 6d 42 61 63 6b | 43 6f 6c 6f 72 28 29 20 |d.PmBack|Color() |
|00000640| 74 6f 20 73 70 65 63 69 | 66 79 20 74 68 65 20 76 |to speci|fy the v|
|00000650| 61 6c 75 65 20 79 6f 75 | 20 77 61 6e 74 20 70 6f |alue you| want po|
|00000660| 6b 65 64 20 69 6e 74 6f | 20 65 61 63 68 20 70 69 |ked into| each pi|
|00000670| 78 65 6c 20 62 79 20 51 | 75 69 63 6b 44 72 61 77 |xel by Q|uickDraw|
|00000680| 0d 6f 70 65 72 61 74 69 | 6f 6e 73 2c 20 65 2e 67 |.operati|ons, e.g|
|00000690| 2e 20 45 72 61 73 65 52 | 65 63 74 28 29 20 61 6e |. EraseR|ect() an|
|000006a0| 64 20 44 72 61 77 53 74 | 72 69 6e 67 28 29 2e 0d |d DrawSt|ring()..|
|000006b0| 0d 52 65 6d 6f 76 65 50 | 61 6c 65 74 74 65 28 77 |.RemoveP|alette(w|
|000006c0| 69 6e 64 6f 77 29 20 64 | 69 73 70 6f 73 65 73 20 |indow) d|isposes |
|000006d0| 6f 66 20 74 68 65 20 70 | 61 6c 65 74 74 65 20 63 |of the p|alette c|
|000006e0| 72 65 61 74 65 64 20 62 | 79 20 41 64 64 45 78 70 |reated b|y AddExp|
|000006f0| 6c 69 63 69 74 50 61 6c | 65 74 74 65 2e 0d 0d 53 |licitPal|ette...S|
|00000700| 77 61 70 57 69 6e 64 6f | 77 45 78 70 6c 69 63 69 |wapWindo|wExplici|
|00000710| 74 4d 6f 64 65 28 77 69 | 6e 64 6f 77 2c 26 65 78 |tMode(wi|ndow,&ex|
|00000720| 70 6c 69 63 69 74 29 20 | 73 77 61 70 73 20 74 68 |plicit) |swaps th|
|00000730| 65 20 63 6f 6e 74 65 6e | 74 73 20 6f 66 20 74 68 |e conten|ts of th|
|00000740| 65 20 42 6f 6f 6c 65 61 | 6e 0d 61 72 67 75 6d 65 |e Boolea|n.argume|
|00000750| 6e 74 20 77 69 74 68 20 | 74 68 65 20 22 65 78 70 |nt with |the "exp|
|00000760| 6c 69 63 69 74 22 20 62 | 69 74 20 28 62 69 74 20 |licit" b|it (bit |
|00000770| 31 34 20 6f 66 20 74 68 | 65 20 63 74 46 6c 61 67 |14 of th|e ctFlag|
|00000780| 73 20 66 69 65 6c 64 29 | 20 69 6e 20 74 68 65 20 |s field)| in the |
|00000790| 63 6f 6c 6f 72 0d 74 61 | 62 6c 65 2e 20 54 68 65 |color.ta|ble. The|
|000007a0| 20 75 73 65 20 6f 66 20 | 74 68 69 73 20 62 69 74 | use of |this bit|
|000007b0| 20 69 73 20 64 6f 63 75 | 6d 65 6e 74 65 64 20 69 | is docu|mented i|
|000007c0| 6e 20 22 56 69 64 65 6f | 54 6f 6f 6c 62 6f 78 3a |n "Video|Toolbox:|
|000007d0| 4e 6f 74 65 73 3a 43 6f | 70 79 42 69 74 73 0d 73 |Notes:Co|pyBits.s|
|000007e0| 6c 61 76 69 73 68 6c 79 | 22 2e 20 41 66 74 65 72 |lavishly|". After|
|000007f0| 20 6d 75 63 68 20 65 78 | 70 65 72 69 6d 65 6e 74 | much ex|periment|
|00000800| 61 74 69 6f 6e 20 49 20 | 64 65 63 69 64 65 64 20 |ation I |decided |
|00000810| 74 68 61 74 20 69 74 27 | 73 20 6e 6f 74 20 75 73 |that it'|s not us|
|00000820| 65 66 75 6c 2c 20 62 75 | 74 20 49 0d 6c 65 61 76 |eful, bu|t I.leav|
|00000830| 65 20 74 68 69 73 20 72 | 6f 75 74 69 6e 65 20 68 |e this r|outine h|
|00000840| 65 72 65 20 66 6f 72 20 | 6f 74 68 65 72 73 20 74 |ere for |others t|
|00000850| 68 61 74 20 77 69 73 68 | 20 74 6f 20 65 78 70 65 |hat wish| to expe|
|00000860| 72 69 6d 65 6e 74 2e 20 | 4e 6f 74 65 20 74 68 61 |riment. |Note tha|
|00000870| 74 20 77 68 65 6e 0d 47 | 44 4f 70 65 6e 57 69 6e |t when.G|DOpenWin|
|00000880| 64 6f 77 28 29 20 63 72 | 65 61 74 65 73 20 61 20 |dow() cr|eates a |
|00000890| 77 69 6e 64 6f 77 2c 20 | 74 68 65 20 77 69 6e 64 |window, |the wind|
|000008a0| 6f 77 20 73 68 61 72 65 | 73 20 74 68 65 20 63 6f |ow share|s the co|
|000008b0| 6c 6f 72 20 74 61 62 6c | 65 20 62 65 6c 6f 6e 67 |lor tabl|e belong|
|000008c0| 69 6e 67 20 74 6f 0d 74 | 68 65 20 64 65 76 69 63 |ing to.t|he devic|
|000008d0| 65 2c 20 73 6f 20 63 61 | 6c 6c 69 6e 67 20 53 77 |e, so ca|lling Sw|
|000008e0| 61 70 57 69 6e 64 6f 77 | 45 78 70 6c 69 63 69 74 |apWindow|Explicit|
|000008f0| 4d 6f 64 65 28 29 20 6d | 6f 64 69 66 69 65 73 20 |Mode() m|odifies |
|00000900| 74 68 65 20 73 68 61 72 | 65 64 20 74 61 62 6c 65 |the shar|ed table|
|00000910| 2c 20 69 2e 65 2e 0d 74 | 68 65 20 64 65 76 69 63 |, i.e..t|he devic|
|00000920| 65 27 73 20 63 6f 6c 6f | 72 20 74 61 62 6c 65 20 |e's colo|r table |
|00000930| 69 73 20 6d 6f 64 69 66 | 69 65 64 2e 20 59 6f 75 |is modif|ied. You|
|00000940| 20 73 68 6f 75 6c 64 20 | 72 65 73 74 6f 72 65 20 | should |restore |
|00000950| 69 74 20 62 79 20 63 61 | 6c 6c 69 6e 67 0d 4d 61 |it by ca|lling.Ma|
|00000960| 6b 65 43 6f 6c 6f 72 54 | 61 62 6c 65 45 78 70 6c |keColorT|ableExpl|
|00000970| 69 63 69 74 28 29 20 61 | 67 61 69 6e 2e 20 46 61 |icit() a|gain. Fa|
|00000980| 69 6c 69 6e 67 20 74 6f | 20 72 65 73 74 6f 72 65 |iling to| restore|
|00000990| 20 69 74 20 77 69 6c 6c | 20 68 61 76 65 20 63 6f | it will| have co|
|000009a0| 73 6d 65 74 69 63 0d 61 | 66 74 65 72 65 66 66 65 |smetic.a|ftereffe|
|000009b0| 63 74 73 2c 20 65 76 65 | 6e 20 61 66 74 65 72 20 |cts, eve|n after |
|000009c0| 79 6f 75 72 20 61 70 70 | 6c 69 63 61 74 69 6f 6e |your app|lication|
|000009d0| 20 71 75 69 74 73 2e 20 | 54 68 65 20 6d 6f 73 74 | quits. |The most|
|000009e0| 20 6f 62 76 69 6f 75 73 | 20 61 66 74 65 72 65 66 | obvious| afteref|
|000009f0| 66 65 63 74 20 69 73 0d | 74 68 61 74 20 64 6f 63 |fect is.|that doc|
|00000a00| 75 6d 65 6e 74 73 20 69 | 6e 20 57 6f 72 64 20 77 |uments i|n Word w|
|00000a10| 69 6c 6c 20 62 65 20 6c | 61 72 67 65 6c 79 20 67 |ill be l|argely g|
|00000a20| 72 61 79 2e 0d 0d 47 65 | 74 42 69 74 4d 61 70 50 |ray...Ge|tBitMapP|
|00000a30| 74 72 28 77 69 6e 64 6f | 77 29 20 72 65 74 75 72 |tr(windo|w) retur|
|00000a40| 6e 73 20 61 20 70 6f 69 | 6e 74 65 72 20 74 6f 20 |ns a poi|nter to |
|00000a50| 74 68 65 20 77 69 6e 64 | 6f 77 27 73 20 62 69 74 |the wind|ow's bit|
|00000a60| 6d 61 70 20 6f 72 20 70 | 69 78 6d 61 70 2e 0d 0d |map or p|ixmap...|
|00000a70| 49 73 47 57 6f 72 6c 64 | 50 74 72 28 77 69 6e 64 |IsGWorld|Ptr(wind|
|00000a80| 6f 77 29 20 72 65 74 75 | 72 6e 73 20 74 72 75 65 |ow) retu|rns true|
|00000a90| 20 6f 6e 6c 79 20 69 66 | 20 74 68 65 20 77 69 6e | only if| the win|
|00000aa0| 64 6f 77 20 69 73 20 61 | 20 47 57 6f 72 6c 64 50 |dow is a| GWorldP|
|00000ab0| 74 72 2e 0d 0d 43 4f 4d | 4d 45 4e 54 53 3a 0d 0d |tr...COM|MENTS:..|
|00000ac0| 50 6c 65 61 73 65 20 72 | 65 61 64 20 22 56 69 64 |Please r|ead "Vid|
|00000ad0| 65 6f 54 6f 6f 6c 62 6f | 78 3a 4e 6f 74 65 73 3a |eoToolbo|x:Notes:|
|00000ae0| 43 6f 70 79 42 69 74 73 | 20 73 6c 61 76 69 73 68 |CopyBits| slavish|
|00000af0| 6c 79 22 2e 20 51 75 69 | 63 6b 44 72 61 77 20 6c |ly". Qui|ckDraw l|
|00000b00| 69 6b 65 73 20 74 6f 0d | 70 69 63 6b 20 61 20 62 |ikes to.|pick a b|
|00000b10| 75 6e 63 68 20 6f 66 20 | 67 6f 6f 64 20 63 6f 6c |unch of |good col|
|00000b20| 6f 72 73 20 61 6e 64 20 | 73 74 75 66 66 20 74 68 |ors and |stuff th|
|00000b30| 65 6d 20 69 6e 20 74 68 | 65 20 63 6c 75 74 2c 20 |em in th|e clut, |
|00000b40| 69 6e 20 65 73 73 65 6e | 74 69 61 6c 6c 79 20 72 |in essen|tially r|
|00000b50| 61 6e 64 6f 6d 0d 6f 72 | 64 65 72 2c 20 65 78 63 |andom.or|der, exc|
|00000b60| 65 70 74 20 74 68 61 74 | 20 77 68 69 74 65 20 69 |ept that| white i|
|00000b70| 73 20 66 69 72 73 74 20 | 61 6e 64 20 62 6c 61 63 |s first |and blac|
|00000b80| 6b 20 69 73 20 6c 61 73 | 74 2e 20 49 74 20 77 61 |k is las|t. It wa|
|00000b90| 6e 74 73 20 79 6f 75 20 | 74 6f 20 73 70 65 63 69 |nts you |to speci|
|00000ba0| 66 79 20 61 6e 79 0d 64 | 65 73 69 72 65 64 20 63 |fy any.d|esired c|
|00000bb0| 6f 6c 6f 72 20 61 73 20 | 61 6e 20 52 47 42 20 74 |olor as |an RGB t|
|00000bc0| 72 69 70 6c 65 74 20 61 | 6e 64 20 74 68 65 6e 20 |riplet a|nd then |
|00000bd0| 69 74 20 70 69 63 6b 73 | 20 74 68 65 20 6d 79 73 |it picks| the mys|
|00000be0| 74 65 72 69 6f 75 73 20 | 63 6c 75 74 20 69 6e 64 |terious |clut ind|
|00000bf0| 65 78 20 74 68 61 74 0d | 77 6f 75 6c 64 20 70 72 |ex that.|would pr|
|00000c00| 6f 76 69 64 65 20 74 68 | 65 20 63 6c 6f 73 65 73 |ovide th|e closes|
|00000c10| 74 20 6d 61 74 63 68 2e | 20 49 66 20 79 6f 75 27 |t match.| If you'|
|00000c20| 72 65 20 70 72 6f 63 65 | 73 73 69 6e 67 20 67 72 |re proce|ssing gr|
|00000c30| 61 79 73 63 61 6c 65 20 | 69 6d 61 67 65 73 2c 20 |ayscale |images, |
|00000c40| 74 68 65 6e 0d 51 75 69 | 63 6b 44 72 61 77 27 73 |then.Qui|ckDraw's|
|00000c50| 20 61 70 70 72 6f 61 63 | 68 20 69 6e 76 6f 6c 76 | approac|h involv|
|00000c60| 65 73 20 61 20 6c 6f 74 | 20 6f 66 20 6f 76 65 72 |es a lot| of over|
|00000c70| 68 65 61 64 20 69 6e 76 | 6f 6c 76 69 6e 67 20 69 |head inv|olving i|
|00000c80| 6e 76 65 72 73 65 20 63 | 6f 6c 6f 72 20 74 61 62 |nverse c|olor tab|
|00000c90| 6c 65 73 2c 0d 61 6e 64 | 20 6d 61 6b 65 73 20 74 |les,.and| makes t|
|00000ca0| 68 65 20 6e 75 6d 62 65 | 72 73 20 73 74 6f 72 65 |he numbe|rs store|
|00000cb0| 64 20 69 6e 20 79 6f 75 | 72 20 70 69 78 65 6c 73 |d in you|r pixels|
|00000cc0| 20 6d 65 61 6e 69 6e 67 | 6c 65 73 73 20 28 75 6e | meaning|less (un|
|00000cd0| 6c 65 73 73 20 79 6f 75 | 20 6c 6f 6f 6b 20 74 68 |less you| look th|
|00000ce0| 65 6d 20 75 70 0d 69 6e | 20 74 68 65 20 61 73 73 |em up.in| the ass|
|00000cf0| 6f 63 69 61 74 65 64 20 | 63 6f 6c 6f 72 20 74 61 |ociated |color ta|
|00000d00| 62 6c 65 20 6f 72 20 70 | 61 6c 65 74 74 65 29 2e |ble or p|alette).|
|00000d10| 0d 0d 54 68 65 20 70 68 | 69 6c 6f 73 6f 70 68 79 |..The ph|ilosophy|
|00000d20| 20 6f 66 20 74 68 65 20 | 56 69 64 65 6f 54 6f 6f | of the |VideoToo|
|00000d30| 6c 62 6f 78 20 69 73 20 | 74 6f 20 62 79 70 61 73 |lbox is |to bypas|
|00000d40| 73 20 51 75 69 63 6b 44 | 72 61 77 27 73 20 63 6f |s QuickD|raw's co|
|00000d50| 6c 6f 72 20 6d 6f 64 65 | 6c 2c 20 61 6e 64 0d 77 |lor mode|l, and.w|
|00000d60| 6f 72 6b 20 65 78 70 6c | 69 63 69 74 6c 79 20 77 |ork expl|icitly w|
|00000d70| 69 74 68 20 74 68 65 20 | 6e 75 6d 62 65 72 73 20 |ith the |numbers |
|00000d80| 74 68 61 74 20 61 72 65 | 20 73 74 6f 72 65 64 20 |that are| stored |
|00000d90| 69 6e 20 79 6f 75 72 20 | 70 69 78 65 6c 73 2e 0d |in your |pixels..|
|00000da0| 53 65 74 50 69 78 65 6c | 73 51 75 69 63 6b 6c 79 |SetPixel|sQuickly|
|00000db0| 20 77 69 6c 6c 20 65 66 | 66 69 63 69 65 6e 74 6c | will ef|ficientl|
|00000dc0| 79 20 70 6f 6b 65 20 28 | 6f 72 20 70 65 65 6b 29 |y poke (|or peek)|
|00000dd0| 20 74 68 65 20 6e 75 6d | 62 65 72 73 20 69 6e 20 | the num|bers in |
|00000de0| 79 6f 75 72 20 50 69 78 | 4d 61 70 2e 0d 48 6f 77 |your Pix|Map..How|
|00000df0| 65 76 65 72 2c 20 69 66 | 20 79 6f 75 20 77 61 6e |ever, if| you wan|
|00000e00| 74 20 74 6f 20 75 73 65 | 20 51 75 69 63 6b 44 72 |t to use| QuickDr|
|00000e10| 61 77 27 73 20 68 61 6e | 64 79 20 64 72 61 77 69 |aw's han|dy drawi|
|00000e20| 6e 67 20 6f 70 65 72 61 | 74 69 6f 6e 73 2c 20 65 |ng opera|tions, e|
|00000e30| 73 70 65 63 69 61 6c 6c | 79 0d 45 72 61 73 65 52 |speciall|y.EraseR|
|00000e40| 65 63 74 28 29 20 61 6e | 64 20 44 72 61 77 53 74 |ect() an|d DrawSt|
|00000e50| 72 69 6e 67 28 29 20 74 | 68 65 6e 20 79 6f 75 20 |ring() t|hen you |
|00000e60| 6e 65 65 64 20 61 20 77 | 61 79 20 74 6f 20 73 70 |need a w|ay to sp|
|00000e70| 65 63 69 66 79 20 74 68 | 65 20 66 6f 72 65 67 72 |ecify th|e foregr|
|00000e80| 6f 75 6e 64 20 61 6e 64 | 0d 62 61 63 6b 67 72 6f |ound and|.backgro|
|00000e90| 75 6e 64 20 63 6f 6c 6f | 72 73 2e 20 41 64 64 45 |und colo|rs. AddE|
|00000ea0| 78 70 6c 69 63 69 74 50 | 61 6c 65 74 74 65 28 29 |xplicitP|alette()|
|00000eb0| 20 67 69 76 65 73 20 79 | 6f 75 72 20 77 69 6e 64 | gives y|our wind|
|00000ec0| 6f 77 20 61 20 70 61 6c | 65 74 74 65 20 69 6e 20 |ow a pal|ette in |
|00000ed0| 77 68 69 63 68 20 61 6c | 6c 0d 74 68 65 20 63 6f |which al|l.the co|
|00000ee0| 6c 6f 72 73 20 61 72 65 | 20 6d 61 72 6b 65 64 20 |lors are| marked |
|00000ef0| 61 73 20 70 6d 45 78 70 | 6c 69 63 69 74 2e 20 54 |as pmExp|licit. T|
|00000f00| 68 69 73 20 74 65 6c 6c | 73 20 74 68 65 20 70 61 |his tell|s the pa|
|00000f10| 6c 65 74 74 65 20 6d 61 | 6e 61 67 65 72 20 74 6f |lette ma|nager to|
|00000f20| 20 75 73 65 20 79 6f 75 | 72 0d 61 72 67 75 6d 65 | use you|r.argume|
|00000f30| 6e 74 73 20 74 6f 20 50 | 6d 46 6f 72 65 43 6f 6c |nts to P|mForeCol|
|00000f40| 6f 72 28 29 20 61 6e 64 | 20 50 6d 42 61 63 6b 43 |or() and| PmBackC|
|00000f50| 6f 6c 6f 72 28 29 20 6c | 69 74 65 72 61 6c 6c 79 |olor() l|iterally|
|00000f60| 2e 0d 0d 49 20 73 75 67 | 67 65 73 74 20 74 68 61 |...I sug|gest tha|
|00000f70| 74 20 79 6f 75 20 63 6f | 6e 74 72 6f 6c 20 74 68 |t you co|ntrol th|
|00000f80| 65 20 63 6c 75 74 20 62 | 79 20 63 61 6c 6c 69 6e |e clut b|y callin|
|00000f90| 67 20 47 44 55 6e 63 6f | 72 72 65 63 74 65 64 47 |g GDUnco|rrectedG|
|00000fa0| 61 6d 6d 61 28 29 20 61 | 6e 64 0d 47 44 53 65 74 |amma() a|nd.GDSet|
|00000fb0| 45 6e 74 72 69 65 73 28 | 29 2c 20 73 69 6e 63 65 |Entries(|), since|
|00000fc0| 20 74 68 65 73 65 20 63 | 61 6c 6c 73 20 64 69 72 | these c|alls dir|
|00000fd0| 65 63 74 6c 79 20 63 6f | 6e 74 72 6f 6c 20 74 68 |ectly co|ntrol th|
|00000fe0| 65 20 76 69 64 65 6f 20 | 64 65 76 69 63 65 20 64 |e video |device d|
|00000ff0| 72 69 76 65 72 2c 0d 62 | 79 70 61 73 73 69 6e 67 |river,.b|ypassing|
|00001000| 20 74 68 65 20 43 6f 6c | 6f 72 20 4d 61 6e 61 67 | the Col|or Manag|
|00001010| 65 72 2e 20 53 69 6e 63 | 65 20 74 68 65 20 43 6f |er. Sinc|e the Co|
|00001020| 6c 6f 72 20 61 6e 64 20 | 50 61 6c 65 74 74 65 20 |lor and |Palette |
|00001030| 4d 61 6e 61 67 65 72 73 | 20 64 6f 6e 27 74 20 6b |Managers| don't k|
|00001040| 6e 6f 77 0d 74 68 61 74 | 20 79 6f 75 27 76 65 20 |now.that| you've |
|00001050| 63 68 61 6e 67 65 64 20 | 74 68 65 20 63 6f 6c 6f |changed |the colo|
|00001060| 72 20 65 6e 76 69 72 6f | 6e 6d 65 6e 74 20 74 68 |r enviro|nment th|
|00001070| 65 79 20 63 61 6e 27 74 | 20 72 65 61 63 74 20 74 |ey can't| react t|
|00001080| 6f 20 69 74 2c 20 61 6e | 64 20 77 69 6c 6c 0d 70 |o it, an|d will.p|
|00001090| 61 73 73 69 76 65 6c 79 | 20 6c 65 74 20 79 6f 75 |assively| let you|
|000010a0| 20 63 6f 6e 74 69 6e 75 | 65 20 74 6f 20 73 70 65 | continu|e to spe|
|000010b0| 63 69 66 79 20 63 6f 6c | 6f 72 73 20 62 79 20 74 |cify col|ors by t|
|000010c0| 68 65 69 72 20 63 6c 75 | 74 20 69 6e 64 65 78 2e |heir clu|t index.|
|000010d0| 20 46 6f 72 20 65 78 61 | 6d 70 6c 65 2c 0d 74 68 | For exa|mple,.th|
|000010e0| 65 20 50 61 6c 65 74 74 | 65 20 4d 61 6e 61 67 65 |e Palett|e Manage|
|000010f0| 72 20 72 65 6c 69 67 69 | 6f 75 73 6c 79 20 62 65 |r religi|ously be|
|00001100| 6c 69 65 76 65 73 20 74 | 68 61 74 20 74 68 65 20 |lieves t|hat the |
|00001110| 66 69 72 73 74 20 63 6c | 75 74 20 65 6e 74 72 79 |first cl|ut entry|
|00001120| 20 73 68 6f 75 6c 64 20 | 62 65 0d 77 68 69 74 65 | should |be.white|
|00001130| 20 61 6e 64 20 74 68 65 | 20 6c 61 73 74 20 6f 6e | and the| last on|
|00001140| 65 20 62 6c 61 63 6b 2c | 20 61 6e 64 20 69 74 20 |e black,| and it |
|00001150| 77 69 6c 6c 20 63 68 61 | 6e 67 65 20 74 68 65 6d |will cha|nge them|
|00001160| 20 62 61 63 6b 20 74 6f | 20 74 68 6f 73 65 20 76 | back to| those v|
|00001170| 61 6c 75 65 73 20 69 66 | 0d 79 6f 75 20 63 68 61 |alues if|.you cha|
|00001180| 6e 67 65 20 74 68 65 6d | 20 61 6e 64 20 69 74 20 |nge them| and it |
|00001190| 66 69 6e 64 73 20 6f 75 | 74 20 61 62 6f 75 74 20 |finds ou|t about |
|000011a0| 69 74 2e 20 49 66 20 79 | 6f 75 20 75 73 65 20 74 |it. If y|ou use t|
|000011b0| 68 65 20 43 6f 6c 6f 72 | 20 4d 61 6e 61 67 65 72 |he Color| Manager|
|000011c0| 0d 53 65 74 45 6e 74 72 | 69 65 73 20 63 61 6c 6c |.SetEntr|ies call|
|000011d0| 20 74 68 65 6e 20 74 68 | 65 20 50 61 6c 65 74 74 | then th|e Palett|
|000011e0| 65 72 20 4d 61 6e 67 65 | 72 20 57 49 4c 4c 20 66 |er Mange|r WILL f|
|000011f0| 69 6e 64 20 6f 75 74 20 | 62 65 63 61 75 73 65 20 |ind out |because |
|00001200| 61 20 72 65 63 6f 72 64 | 20 69 73 20 6d 61 64 65 |a record| is made|
|00001210| 0d 69 6e 20 74 68 65 20 | 43 6f 6c 6f 72 54 61 62 |.in the |ColorTab|
|00001220| 6c 65 2e 20 43 61 6c 6c | 69 6e 67 20 47 44 53 65 |le. Call|ing GDSe|
|00001230| 74 45 6e 74 72 69 65 73 | 28 29 20 62 79 70 61 73 |tEntries|() bypas|
|00001240| 73 65 73 20 74 68 65 20 | 43 6f 6c 6f 72 20 4d 61 |ses the |Color Ma|
|00001250| 6e 61 67 65 72 2e 20 49 | 6e 73 74 65 61 64 2c 0d |nager. I|nstead,.|
|00001260| 74 68 65 20 76 69 64 65 | 6f 20 64 65 76 69 63 65 |the vide|o device|
|00001270| 20 64 72 69 76 65 72 20 | 77 72 69 74 65 73 20 64 | driver |writes d|
|00001280| 69 72 65 63 74 6c 79 20 | 74 6f 20 74 68 65 20 63 |irectly |to the c|
|00001290| 6c 75 74 20 61 6e 64 20 | 74 68 65 20 43 6f 6c 6f |lut and |the Colo|
|000012a0| 72 54 61 62 6c 65 20 69 | 73 20 6e 6f 74 0d 6d 6f |rTable i|s not.mo|
|000012b0| 64 69 66 69 65 64 2e 20 | 4f 66 20 63 6f 75 72 73 |dified. |Of cours|
|000012c0| 65 2c 20 74 68 69 73 20 | 6d 65 61 6e 73 20 74 68 |e, this |means th|
|000012d0| 61 74 20 79 6f 75 20 73 | 68 6f 75 6c 64 20 69 67 |at you s|hould ig|
|000012e0| 6e 6f 72 65 20 74 68 65 | 20 43 6f 6c 6f 72 54 61 |nore the| ColorTa|
|000012f0| 62 6c 65 20 73 69 6e 63 | 65 20 69 74 0d 77 69 6c |ble sinc|e it.wil|
|00001300| 6c 20 6e 6f 20 6c 6f 6e | 67 65 72 20 72 65 66 6c |l no lon|ger refl|
|00001310| 65 63 74 20 74 68 65 20 | 63 6f 6e 74 65 6e 74 73 |ect the |contents|
|00001320| 20 6f 66 20 74 68 65 20 | 63 6c 75 74 2e 0d 0d 45 | of the |clut...E|
|00001330| 76 65 72 79 20 74 69 6d | 65 20 79 6f 75 20 61 63 |very tim|e you ac|
|00001340| 63 65 73 73 20 74 68 65 | 20 73 74 64 69 6f 20 70 |cess the| stdio p|
|00001350| 61 63 6b 61 67 65 2c 20 | 65 2e 67 2e 20 70 72 69 |ackage, |e.g. pri|
|00001360| 6e 74 66 20 6f 72 20 67 | 65 74 63 68 28 29 2c 20 |ntf or g|etch(), |
|00001370| 54 48 49 4e 4b 20 43 20 | 77 69 6c 6c 0d 6d 6f 76 |THINK C |will.mov|
|00001380| 65 20 74 68 65 20 63 6f | 6e 73 6f 6c 65 20 77 69 |e the co|nsole wi|
|00001390| 6e 64 6f 77 20 74 6f 20 | 74 68 65 20 66 72 6f 6e |ndow to |the fron|
|000013a0| 74 2c 20 77 68 69 63 68 | 20 6d 61 79 20 6f 62 73 |t, which| may obs|
|000013b0| 63 75 72 65 20 79 6f 75 | 72 20 77 69 6e 64 6f 77 |cure you|r window|
|000013c0| 2e 20 59 6f 75 20 63 61 | 6e 0d 62 72 69 6e 67 20 |. You ca|n.bring |
|000013d0| 79 6f 75 72 20 77 69 6e | 64 6f 77 20 62 61 63 6b |your win|dow back|
|000013e0| 20 74 6f 20 74 68 65 20 | 66 72 6f 6e 74 20 62 79 | to the |front by|
|000013f0| 20 63 61 6c 6c 69 6e 67 | 20 42 72 69 6e 67 54 6f | calling| BringTo|
|00001400| 46 72 6f 6e 74 28 29 20 | 6f 72 20 53 65 6c 65 63 |Front() |or Selec|
|00001410| 74 57 69 6e 64 77 6f 28 | 29 2e 0d 0d 4e 4f 54 45 |tWindwo(|)...NOTE|
|00001420| 3a 0d 54 6f 6d 20 42 75 | 73 65 79 20 28 62 75 73 |:.Tom Bu|sey (bus|
|00001430| 65 79 40 69 6e 64 69 61 | 6e 61 2e 65 64 75 29 20 |ey@india|na.edu) |
|00001440| 77 72 69 74 65 73 3a 20 | 22 49 27 6d 20 75 73 69 |writes: |"I'm usi|
|00001450| 6e 67 20 61 6e 20 38 2d | 62 69 74 20 53 75 70 65 |ng an 8-|bit Supe|
|00001460| 72 4d 61 63 20 43 6f 6c | 6f 72 43 61 72 64 0d 74 |rMac Col|orCard.t|
|00001470| 68 61 74 20 61 20 75 73 | 65 64 20 63 6f 6d 70 75 |hat a us|ed compu|
|00001480| 74 65 72 20 64 65 61 6c | 65 72 20 67 61 76 65 20 |ter deal|er gave |
|00001490| 6d 65 20 77 68 65 6e 20 | 49 20 6f 72 64 65 72 65 |me when |I ordere|
|000014a0| 64 20 61 20 54 6f 62 79 | 20 63 61 72 64 2e 20 49 |d a Toby| card. I|
|000014b0| 20 64 69 73 63 6f 76 65 | 72 65 64 0d 74 68 61 74 | discove|red.that|
|000014c0| 20 74 68 65 20 73 74 61 | 74 75 73 20 61 6e 64 20 | the sta|tus and |
|000014d0| 63 6f 6e 74 72 6f 6c 20 | 63 61 6c 6c 73 20 66 6f |control |calls fo|
|000014e0| 72 20 47 44 55 6e 63 6f | 72 72 65 63 74 65 64 47 |r GDUnco|rrectedG|
|000014f0| 61 6d 6d 61 20 72 65 74 | 75 72 6e 20 2d 31 37 20 |amma ret|urn -17 |
|00001500| 61 6e 64 20 2d 31 38 0d | 72 65 73 70 65 63 74 69 |and -18.|respecti|
|00001510| 76 65 6c 79 2c 20 77 68 | 69 63 68 20 6d 65 61 6e |vely, wh|ich mean|
|00001520| 73 20 74 68 61 74 20 74 | 68 65 20 64 72 69 76 65 |s that t|he drive|
|00001530| 72 20 64 6f 65 73 6e 27 | 74 20 73 75 70 70 6f 72 |r doesn'|t suppor|
|00001540| 74 20 64 69 66 66 65 72 | 65 6e 74 20 67 61 6d 6d |t differ|ent gamm|
|00001550| 61 73 2e 0d 47 44 55 6e | 63 6f 72 72 65 63 74 65 |as..GDUn|correcte|
|00001560| 64 47 61 6d 6d 61 20 72 | 65 74 75 72 6e 73 20 61 |dGamma r|eturns a|
|00001570| 6e 20 65 72 72 6f 72 20 | 6d 65 73 73 61 67 65 2c |n error |message,|
|00001580| 20 62 75 74 20 47 44 4f | 70 65 6e 57 69 6e 64 6f | but GDO|penWindo|
|00001590| 77 20 64 6f 65 73 6e 27 | 74 20 75 73 65 20 74 68 |w doesn'|t use th|
|000015a0| 65 0d 65 72 72 6f 72 20 | 6d 65 73 73 61 67 65 20 |e.error |message |
|000015b0| 6f 72 20 70 61 73 73 20 | 69 74 20 62 61 63 6b 20 |or pass |it back |
|000015c0| 74 6f 20 74 68 65 20 63 | 61 6c 6c 69 6e 67 20 70 |to the c|alling p|
|000015d0| 72 6f 67 72 61 6d 2e 20 | 49 27 6d 20 77 6f 6e 64 |rogram. |I'm wond|
|000015e0| 65 72 69 6e 67 20 69 66 | 20 74 68 65 72 65 20 61 |ering if| there a|
|000015f0| 72 65 0d 70 65 6f 70 6c | 65 20 75 73 69 6e 67 20 |re.peopl|e using |
|00001600| 47 44 4f 70 65 6e 57 69 | 6e 64 6f 77 20 77 68 6f |GDOpenWi|ndow who|
|00001610| 20 74 68 69 6e 6b 20 74 | 68 61 74 20 74 68 65 79 | think t|hat they|
|00001620| 20 61 72 65 20 67 65 74 | 74 69 6e 67 20 61 20 6c | are get|ting a l|
|00001630| 69 6e 65 61 72 20 67 61 | 6d 6d 61 20 62 75 74 20 |inear ga|mma but |
|00001640| 77 68 6f 0d 61 72 65 20 | 61 63 74 75 61 6c 6c 79 |who.are |actually|
|00001650| 20 67 65 74 74 69 6e 67 | 20 61 6e 20 65 72 72 6f | getting| an erro|
|00001660| 72 20 6d 65 73 73 61 67 | 65 20 61 6e 64 20 6e 6f |r messag|e and no|
|00001670| 74 20 6c 65 61 72 6e 69 | 6e 67 20 61 62 6f 75 74 |t learni|ng about|
|00001680| 20 69 74 2e 22 0d 20 20 | 20 20 20 54 6f 6d 27 73 | it.". | Tom's|
|00001690| 20 66 61 63 74 73 20 61 | 72 65 20 72 69 67 68 74 | facts a|re right|
|000016a0| 2c 20 62 75 74 20 68 65 | 20 6e 65 65 64 6e 27 74 |, but he| needn't|
|000016b0| 20 77 6f 72 72 79 2e 20 | 41 20 66 65 77 20 76 69 | worry. |A few vi|
|000016c0| 64 65 6f 20 64 72 69 76 | 65 72 73 2c 20 65 2e 67 |deo driv|ers, e.g|
|000016d0| 2e 0d 52 61 64 69 75 73 | 20 50 6f 77 65 72 56 69 |..Radius| PowerVi|
|000016e0| 65 77 2c 20 61 6e 64 20 | 61 70 70 61 72 65 6e 74 |ew, and |apparent|
|000016f0| 6c 79 20 74 68 65 20 53 | 75 70 65 72 4d 61 63 20 |ly the S|uperMac |
|00001700| 43 6f 6c 6f 72 43 61 72 | 64 2c 20 64 6f 6e 27 74 |ColorCar|d, don't|
|00001710| 20 69 6d 70 6c 65 6d 65 | 6e 74 20 67 61 6d 6d 61 | impleme|nt gamma|
|00001720| 0d 74 61 62 6c 65 73 20 | 61 74 20 61 6c 6c 2c 20 |.tables |at all, |
|00001730| 62 75 74 20 74 68 65 20 | 65 72 72 6f 72 20 66 72 |but the |error fr|
|00001740| 6f 6d 20 47 44 55 6e 63 | 6f 72 72 65 63 74 65 64 |om GDUnc|orrected|
|00001750| 47 61 6d 6d 61 20 69 73 | 20 70 72 6f 62 61 62 6c |Gamma is| probabl|
|00001760| 79 20 6e 6f 74 20 61 20 | 63 6f 6e 63 65 72 6e 2e |y not a |concern.|
|00001770| 0d 54 68 65 20 72 65 61 | 6c 20 74 65 73 74 20 69 |.The rea|l test i|
|00001780| 73 20 74 6f 20 72 75 6e | 20 54 69 6d 65 56 69 64 |s to run| TimeVid|
|00001790| 65 6f 2e 20 54 69 6d 65 | 56 69 64 65 6f 20 64 6f |eo. Time|Video do|
|000017a0| 65 73 20 61 20 77 72 69 | 74 65 2d 61 6e 64 2d 72 |es a wri|te-and-r|
|000017b0| 65 61 64 2d 62 61 63 6b | 20 74 65 73 74 20 6f 66 |ead-back| test of|
|000017c0| 0d 74 68 65 20 63 6c 75 | 74 20 6f 66 20 79 6f 75 |.the clu|t of you|
|000017d0| 72 20 76 69 64 65 6f 20 | 63 61 72 64 2e 20 49 66 |r video |card. If|
|000017e0| 20 74 68 61 74 20 74 65 | 73 74 20 70 61 73 73 65 | that te|st passe|
|000017f0| 73 20 74 68 65 6e 20 79 | 6f 75 20 63 61 6e 20 73 |s then y|ou can s|
|00001800| 61 66 65 6c 79 20 63 6f | 6e 63 6c 75 64 65 0d 74 |afely co|nclude.t|
|00001810| 68 61 74 20 74 68 65 72 | 65 27 73 20 6e 6f 20 67 |hat ther|e's no g|
|00001820| 61 6d 6d 61 20 74 72 61 | 6e 73 6c 61 74 69 6f 6e |amma tra|nslation|
|00001830| 20 67 6f 69 6e 67 20 6f | 6e 2e 20 53 6f 2c 20 61 | going o|n. So, a|
|00001840| 73 20 6e 65 61 72 6c 79 | 20 65 76 65 72 79 20 64 |s nearly| every d|
|00001850| 6f 63 75 6d 65 6e 74 20 | 69 6e 20 74 68 65 0d 56 |ocument |in the.V|
|00001860| 69 64 65 6f 54 6f 6f 6c | 62 6f 78 20 73 61 79 73 |ideoTool|box says|
|00001870| 3a 20 72 75 6e 20 54 69 | 6d 65 56 69 64 65 6f 20 |: run Ti|meVideo |
|00001880| 61 6e 64 20 72 65 61 64 | 20 74 68 65 20 72 65 70 |and read| the rep|
|00001890| 6f 72 74 2e 0d 20 20 20 | 20 20 48 65 72 65 27 73 |ort.. | Here's|
|000018a0| 20 68 6f 77 20 67 61 6d | 6d 61 20 74 61 62 6c 65 | how gam|ma table|
|000018b0| 73 20 77 6f 72 6b 2e 20 | 41 63 63 6f 72 64 69 6e |s work. |Accordin|
|000018c0| 67 20 74 6f 20 74 68 65 | 20 41 70 70 6c 65 20 6d |g to the| Apple m|
|000018d0| 61 6e 75 61 6c 20 28 44 | 65 73 69 67 6e 69 6e 67 |anual (D|esigning|
|000018e0| 0d 43 61 72 64 73 20 61 | 6e 64 20 44 72 69 76 65 |.Cards a|nd Drive|
|000018f0| 72 73 29 2c 20 74 68 65 | 20 76 61 6c 75 65 73 20 |rs), the| values |
|00001900| 69 6e 20 74 68 65 20 72 | 67 62 20 74 72 69 70 6c |in the r|gb tripl|
|00001910| 65 74 73 20 74 68 61 74 | 20 79 6f 75 20 73 75 70 |ets that| you sup|
|00001920| 70 6c 79 20 69 6e 20 61 | 0d 73 65 74 65 6e 74 72 |ply in a|.setentr|
|00001930| 69 65 73 20 63 61 6c 6c | 20 74 6f 20 74 68 65 20 |ies call| to the |
|00001940| 76 69 64 65 6f 20 64 72 | 69 76 65 72 20 61 72 65 |video dr|iver are|
|00001950| 20 66 69 72 73 74 20 74 | 72 61 6e 73 6c 61 74 65 | first t|ranslate|
|00001960| 64 20 76 69 61 20 74 68 | 65 20 67 61 6d 6d 61 20 |d via th|e gamma |
|00001970| 74 61 62 6c 65 0d 28 65 | 61 63 68 20 72 2c 67 2c |table.(e|ach r,g,|
|00001980| 20 61 6e 64 20 62 20 63 | 6f 6d 70 6f 6e 65 6e 74 | and b c|omponent|
|00001990| 20 73 65 70 61 72 61 74 | 65 6c 79 29 20 62 65 66 | separat|ely) bef|
|000019a0| 6f 72 65 20 62 65 69 6e | 67 20 6c 6f 61 64 65 64 |ore bein|g loaded|
|000019b0| 20 69 6e 74 6f 20 74 68 | 65 20 43 4c 55 54 0d 68 | into th|e CLUT.h|
|000019c0| 61 72 64 77 61 72 65 20 | 74 61 62 6c 65 2e 20 4d |ardware |table. M|
|000019d0| 6f 73 74 20 64 72 69 76 | 65 72 73 20 6d 61 69 6e |ost driv|ers main|
|000019e0| 74 61 69 6e 20 61 20 67 | 61 6d 6d 61 20 74 61 62 |tain a g|amma tab|
|000019f0| 6c 65 20 69 6e 74 65 72 | 6e 61 6c 6c 79 20 28 69 |le inter|nally (i|
|00001a00| 6e 20 63 6f 6d 70 75 74 | 65 72 0d 6d 65 6d 6f 72 |n comput|er.memor|
|00001a10| 79 29 20 61 6e 64 20 61 | 6c 6c 6f 77 20 79 6f 75 |y) and a|llow you|
|00001a20| 20 74 6f 20 67 65 74 20 | 61 6e 64 20 73 65 74 20 | to get |and set |
|00001a30| 69 74 20 76 69 61 20 74 | 68 65 20 47 44 47 65 74 |it via t|he GDGet|
|00001a40| 47 61 6d 6d 61 20 61 6e | 64 20 47 44 53 65 74 47 |Gamma an|d GDSetG|
|00001a50| 61 6d 6d 61 20 63 61 6c | 6c 73 2e 0d 41 20 66 65 |amma cal|ls..A fe|
|00001a60| 77 20 76 69 64 65 6f 20 | 64 72 69 76 65 72 73 20 |w video |drivers |
|00001a70| 28 52 61 64 69 75 73 20 | 50 6f 77 65 72 56 69 65 |(Radius |PowerVie|
|00001a80| 77 2c 20 53 75 70 65 72 | 4d 61 63 20 43 6f 6c 6f |w, Super|Mac Colo|
|00001a90| 72 43 61 72 64 29 20 64 | 6f 6e 27 74 20 73 75 70 |rCard) d|on't sup|
|00001aa0| 70 6f 72 74 20 67 61 6d | 6d 61 0d 74 61 62 6c 65 |port gam|ma.table|
|00001ab0| 73 2e 20 54 68 65 79 20 | 6c 6f 61 64 20 79 6f 75 |s. They |load you|
|00001ac0| 72 20 72 67 62 20 76 61 | 6c 75 65 73 20 64 69 72 |r rgb va|lues dir|
|00001ad0| 65 63 74 6c 79 20 69 6e | 74 6f 20 74 68 65 20 43 |ectly in|to the C|
|00001ae0| 4c 55 54 2c 20 77 69 74 | 68 6f 75 74 20 74 72 61 |LUT, wit|hout tra|
|00001af0| 6e 73 6c 61 74 69 6f 6e | 2e 0d 48 6f 77 65 76 65 |nslation|..Howeve|
|00001b00| 72 2c 20 66 6f 72 20 75 | 73 65 72 73 20 6f 66 20 |r, for u|sers of |
|00001b10| 74 68 65 20 56 69 64 65 | 6f 54 6f 6f 6c 62 6f 78 |the Vide|oToolbox|
|00001b20| 20 74 68 61 74 27 73 20 | 75 73 75 61 6c 6c 79 20 | that's |usually |
|00001b30| 66 69 6e 65 2c 20 73 69 | 6e 63 65 20 74 68 61 74 |fine, si|nce that|
|00001b40| 27 73 20 65 78 61 63 74 | 6c 79 0d 74 68 65 20 62 |'s exact|ly.the b|
|00001b50| 65 68 61 76 69 6f 72 20 | 74 68 61 74 20 77 65 20 |ehavior |that we |
|00001b60| 72 6f 75 74 69 6e 65 6c | 79 20 72 65 71 75 65 73 |routinel|y reques|
|00001b70| 74 20 62 79 20 63 61 6c | 6c 69 6e 67 20 47 44 55 |t by cal|ling GDU|
|00001b80| 6e 63 6f 72 72 65 63 74 | 65 64 47 61 6d 6d 61 2e |ncorrect|edGamma.|
|00001b90| 20 4f 66 20 63 6f 75 72 | 73 65 2c 0d 69 66 20 79 | Of cour|se,.if y|
|00001ba0| 6f 75 20 77 61 6e 74 20 | 74 6f 20 6c 6f 61 64 20 |ou want |to load |
|00001bb0| 61 20 63 75 73 74 6f 6d | 20 67 61 6d 6d 61 20 74 |a custom| gamma t|
|00001bc0| 61 62 6c 65 2c 20 6f 74 | 68 65 72 20 74 68 61 6e |able, ot|her than|
|00001bd0| 20 74 68 65 20 69 64 65 | 6e 74 69 74 79 0d 74 72 | the ide|ntity.tr|
|00001be0| 61 6e 73 66 6f 72 6d 61 | 74 69 6f 6e 2c 20 74 68 |ansforma|tion, th|
|00001bf0| 65 6e 20 79 6f 75 27 6c | 6c 20 62 65 20 63 61 6c |en you'l|l be cal|
|00001c00| 6c 69 6e 67 20 47 44 53 | 65 74 47 61 6d 6d 61 2c |ling GDS|etGamma,|
|00001c10| 20 61 6e 64 20 79 6f 75 | 20 73 68 6f 75 6c 64 20 | and you| should |
|00001c20| 6d 61 6b 65 20 73 75 72 | 65 20 69 74 0d 64 6f 65 |make sur|e it.doe|
|00001c30| 73 20 6e 6f 74 20 72 65 | 74 75 72 6e 20 61 6e 20 |s not re|turn an |
|00001c40| 65 72 72 6f 72 2e 20 28 | 41 6c 61 73 2c 20 74 68 |error. (|Alas, th|
|00001c50| 65 20 52 61 64 69 75 73 | 20 50 6f 77 65 72 56 69 |e Radius| PowerVi|
|00001c60| 65 77 20 64 72 69 76 65 | 72 20 6d 6f 72 65 20 6f |ew drive|r more o|
|00001c70| 72 20 6c 65 73 73 0d 69 | 67 6e 6f 72 65 73 20 74 |r less.i|gnores t|
|00001c80| 68 65 20 73 65 74 2d 20 | 61 6e 64 20 67 65 74 2d |he set- |and get-|
|00001c90| 67 61 6d 6d 61 20 72 65 | 71 75 65 73 74 73 2d 2d |gamma re|quests--|
|00001ca0| 47 44 47 65 74 47 61 6d | 6d 61 20 72 65 74 75 72 |GDGetGam|ma retur|
|00001cb0| 6e 73 20 61 20 74 61 62 | 6c 65 20 74 68 61 74 27 |ns a tab|le that'|
|00001cc0| 73 20 61 6c 6c 0d 7a 65 | 72 6f 65 73 2d 2d 62 75 |s all.ze|roes--bu|
|00001cd0| 74 20 74 68 65 20 64 72 | 69 76 65 72 20 66 61 69 |t the dr|iver fai|
|00001ce0| 6c 73 20 74 6f 20 72 65 | 70 6f 72 74 20 61 6e 20 |ls to re|port an |
|00001cf0| 65 72 72 6f 72 2e 20 49 | 20 77 72 6f 74 65 20 74 |error. I| wrote t|
|00001d00| 6f 20 74 68 65 20 52 61 | 64 69 75 73 0d 70 72 6f |o the Ra|dius.pro|
|00001d10| 67 72 61 6d 6d 65 72 20 | 61 20 79 65 61 72 20 61 |grammer |a year a|
|00001d20| 67 6f 2c 20 62 75 74 20 | 74 68 65 79 27 72 65 20 |go, but |they're |
|00001d30| 6e 6f 20 6c 6f 6e 67 65 | 72 20 69 6e 74 65 72 65 |no longe|r intere|
|00001d40| 73 74 65 64 20 69 6e 20 | 77 6f 72 6b 69 6e 67 20 |sted in |working |
|00001d50| 6f 6e 20 74 68 61 74 0d | 70 72 6f 64 75 63 74 2e |on that.|product.|
|00001d60| 29 0d 20 20 20 20 20 0d | 0d 50 52 4f 42 4c 45 4d |). .|.PROBLEM|
|00001d70| 3a 0d 48 6f 77 20 63 61 | 6e 20 49 20 74 65 6c 6c |:.How ca|n I tell|
|00001d80| 20 77 68 65 74 68 65 72 | 20 49 27 76 65 20 67 6f | whether| I've go|
|00001d90| 74 20 61 20 43 47 72 61 | 66 50 74 72 20 6f 72 20 |t a CGra|fPtr or |
|00001da0| 61 20 47 57 6f 72 6c 64 | 50 74 72 3f 20 28 49 6e |a GWorld|Ptr? (In|
|00001db0| 20 6f 6e 65 20 63 61 73 | 65 20 49 27 6c 6c 20 63 | one cas|e I'll c|
|00001dc0| 61 6c 6c 20 0d 47 65 74 | 47 57 6f 72 6c 64 44 65 |all .Get|GWorldDe|
|00001dd0| 76 69 63 65 2c 20 69 6e | 20 74 68 65 20 6f 74 68 |vice, in| the oth|
|00001de0| 65 72 20 63 61 73 65 20 | 49 27 6c 6c 20 67 65 74 |er case |I'll get|
|00001df0| 20 6d 61 78 20 64 65 76 | 69 63 65 2e 29 0d 49 20 | max dev|ice.).I |
|00001e00| 6e 6f 74 69 63 65 64 20 | 74 68 61 74 20 74 68 65 |noticed |that the|
|00001e10| 20 70 6f 72 74 56 65 72 | 73 69 6f 6e 73 20 61 72 | portVer|sions ar|
|00001e20| 65 20 30 78 63 30 30 31 | 20 61 6e 64 20 30 78 63 |e 0xc001| and 0xc|
|00001e30| 30 30 30 2e 20 53 68 6f | 75 6c 64 20 49 20 75 73 |000. Sho|uld I us|
|00001e40| 65 20 74 68 61 74 20 74 | 6f 20 74 65 6c 6c 3f 0d |e that t|o tell?.|
|00001e50| 0d 41 4e 53 57 45 52 20 | 46 52 4f 4d 20 41 50 50 |.ANSWER |FROM APP|
|00001e60| 4c 45 20 44 45 56 53 55 | 50 50 4f 52 54 20 28 38 |LE DEVSU|PPORT (8|
|00001e70| 2f 39 33 29 3a 0d 59 6f | 75 20 63 61 6e 20 75 73 |/93):.Yo|u can us|
|00001e80| 65 20 47 65 74 47 57 6f | 72 6c 64 44 65 76 69 63 |e GetGWo|rldDevic|
|00001e90| 65 28 29 20 6f 6e 20 47 | 57 6f 72 6c 64 50 74 72 |e() on G|WorldPtr|
|00001ea0| 2c 20 47 72 61 66 50 6f | 72 74 20 6f 72 20 43 47 |, GrafPo|rt or CG|
|00001eb0| 72 61 66 50 6f 72 74 2e | 20 55 73 65 0d 54 65 73 |rafPort.| Use.Tes|
|00001ec0| 74 44 65 76 69 63 65 41 | 74 74 69 62 75 74 65 28 |tDeviceA|ttibute(|
|00001ed0| 29 20 74 6f 20 74 65 73 | 74 20 69 66 20 74 68 65 |) to tes|t if the|
|00001ee0| 20 72 65 74 75 72 6e 65 | 64 20 47 44 48 61 6e 64 | returne|d GDHand|
|00001ef0| 6c 65 20 69 73 20 61 20 | 22 72 65 61 6c 22 20 73 |le is a |"real" s|
|00001f00| 63 72 65 65 6e 20 6f 72 | 20 6e 6f 74 2e 0d 0d 41 |creen or| not...A|
|00001f10| 6c 73 6f 2c 20 79 6f 75 | 20 73 68 6f 75 6c 64 20 |lso, you| should |
|00001f20| 72 65 66 65 72 20 74 6f | 20 74 68 65 20 74 65 63 |refer to| the tec|
|00001f30| 68 20 6e 6f 74 65 20 d2 | 52 6f 77 42 79 74 65 73 |h note .|RowBytes|
|00001f40| 20 52 65 76 65 61 6c 65 | 64 20 49 49 d3 20 28 61 | Reveale|d II. (a|
|00001f50| 76 61 69 6c 61 62 6c 65 | 20 6f 6e 20 74 68 65 0d |vailable| on the.|
|00001f60| 4a 75 6e 65 20 44 65 76 | 65 6c 6f 70 65 72 20 43 |June Dev|eloper C|
|00001f70| 44 29 20 77 68 69 63 68 | 20 73 74 61 74 65 73 3a |D) which| states:|
|00001f80| 0d 0d 59 6f 75 27 6c 6c | 20 6e 6f 74 69 63 65 20 |..You'll| notice |
|00001f90| 69 6e 20 46 69 67 75 72 | 65 20 31 20 74 68 61 74 |in Figur|e 1 that|
|00001fa0| 20 74 68 65 20 70 6f 72 | 74 56 65 72 73 69 6f 6e | the por|tVersion|
|00001fb0| 20 66 69 65 6c 64 20 6f | 66 20 61 20 63 47 72 61 | field o|f a cGra|
|00001fc0| 66 50 6f 72 74 20 63 6f | 69 6e 63 69 64 65 73 0d |fPort co|incides.|
|00001fd0| 77 69 74 68 20 74 68 65 | 20 6c 6f 63 61 74 69 6f |with the| locatio|
|00001fe0| 6e 20 6f 66 20 74 68 65 | 20 72 6f 77 42 79 74 65 |n of the| rowByte|
|00001ff0| 73 20 66 69 65 6c 64 20 | 6f 66 20 61 20 67 72 61 |s field |of a gra|
|00002000| 66 50 6f 72 74 2e 20 52 | 65 6d 65 6d 62 65 72 2c |fPort. R|emember,|
|00002010| 20 61 20 63 47 72 61 66 | 50 6f 72 74 20 68 61 73 | a cGraf|Port has|
|00002020| 0d 74 68 65 20 73 61 6d | 65 20 73 69 7a 65 20 61 |.the sam|e size a|
|00002030| 73 20 61 20 67 72 61 66 | 50 6f 72 74 2e 20 44 75 |s a graf|Port. Du|
|00002040| 72 69 6e 67 20 64 65 62 | 75 67 67 69 6e 67 2c 20 |ring deb|ugging, |
|00002050| 79 6f 75 20 63 61 6e 20 | 75 73 65 20 74 68 65 20 |you can |use the |
|00002060| 73 61 6d 65 20 69 6e 66 | 6f 72 6d 61 74 69 6f 6e |same inf|ormation|
|00002070| 0d 74 68 61 74 20 43 6f | 70 79 42 69 74 73 20 75 |.that Co|pyBits u|
|00002080| 73 65 73 20 74 6f 20 69 | 64 65 6e 74 69 66 79 20 |ses to i|dentify |
|00002090| 63 47 72 61 66 50 6f 72 | 74 73 2e 0d 0d 49 66 20 |cGrafPor|ts...If |
|000020a0| 79 6f 75 20 75 73 65 20 | 61 20 67 72 61 66 50 6f |you use |a grafPo|
|000020b0| 72 74 20 74 65 6d 70 6c | 61 74 65 20 74 6f 20 64 |rt templ|ate to d|
|000020c0| 69 73 70 6c 61 79 20 6d | 65 6d 6f 72 79 20 66 6f |isplay m|emory fo|
|000020d0| 72 20 61 6e 20 75 6e 6b | 6e 6f 77 6e 20 67 72 61 |r an unk|nown gra|
|000020e0| 66 50 6f 72 74 2c 20 79 | 6f 75 0d 63 61 6e 20 74 |fPort, y|ou.can t|
|000020f0| 65 6c 6c 20 69 66 20 69 | 74 20 69 73 20 61 20 63 |ell if i|t is a c|
|00002100| 47 72 61 66 50 6f 72 74 | 20 62 65 63 61 75 73 65 |GrafPort| because|
|00002110| 20 74 68 65 20 72 6f 77 | 42 79 74 65 73 20 77 69 | the row|Bytes wi|
|00002120| 6c 6c 20 62 65 20 65 71 | 75 61 6c 20 74 6f 20 30 |ll be eq|ual to 0|
|00002130| 78 43 30 30 30 2e 20 54 | 68 65 0d 30 78 43 20 63 |xC000. T|he.0xC c|
|00002140| 6f 72 72 65 73 70 6f 6e | 64 73 20 74 6f 20 74 68 |orrespon|ds to th|
|00002150| 65 20 74 77 6f 20 68 69 | 67 68 20 62 69 74 73 20 |e two hi|gh bits |
|00002160| 62 65 69 6e 67 20 73 65 | 74 20 69 6e 20 74 68 65 |being se|t in the|
|00002170| 20 70 6f 72 74 56 65 72 | 73 69 6f 6e 20 66 69 65 | portVer|sion fie|
|00002180| 6c 64 20 6f 66 20 61 0d | 63 47 72 61 66 50 6f 72 |ld of a.|cGrafPor|
|00002190| 74 2e 20 53 69 6e 63 65 | 20 74 68 65 73 65 20 62 |t. Since| these b|
|000021a0| 69 74 73 20 63 61 6e 20 | 6e 6f 74 20 62 65 20 73 |its can |not be s|
|000021b0| 65 74 20 69 6e 20 61 20 | 67 72 61 66 50 6f 72 74 |et in a |grafPort|
|000021c0| 2c 20 79 6f 75 20 6b 6e | 6f 77 20 79 6f 75 20 68 |, you kn|ow you h|
|000021d0| 61 76 65 20 61 0d 63 47 | 72 61 66 50 6f 72 74 2e |ave a.cG|rafPort.|
|000021e0| 20 49 6e 20 61 64 64 69 | 74 69 6f 6e 2c 20 69 66 | In addi|tion, if|
|000021f0| 20 74 68 65 20 62 6f 74 | 74 6f 6d 20 62 69 74 20 | the bot|tom bit |
|00002200| 6f 66 20 74 68 65 20 70 | 6f 72 74 56 65 72 73 69 |of the p|ortVersi|
|00002210| 6f 6e 20 66 69 65 6c 64 | 20 69 73 20 73 65 74 2c |on field| is set,|
|00002220| 20 74 68 65 6e 0d 69 74 | 20 69 73 20 61 20 67 57 | then.it| is a gW|
|00002230| 6f 72 6c 64 2e 20 54 68 | 75 73 2c 20 69 66 20 79 |orld. Th|us, if y|
|00002240| 6f 75 72 20 72 6f 77 42 | 79 74 65 73 20 66 69 65 |our rowB|ytes fie|
|00002250| 6c 64 20 68 61 73 20 61 | 20 76 61 6c 75 65 20 6f |ld has a| value o|
|00002260| 66 20 30 78 43 30 30 31 | 2c 20 74 68 65 6e 20 79 |f 0xC001|, then y|
|00002270| 6f 75 0d 6b 6e 6f 77 20 | 79 6f 75 20 68 61 76 65 |ou.know |you have|
|00002280| 20 61 20 67 57 6f 72 6c | 64 2e 0d 0d 43 4f 4e 43 | a gWorl|d...CONC|
|00002290| 4c 55 53 49 4f 4e 3a 0d | 54 68 69 73 20 61 64 76 |LUSION:.|This adv|
|000022a0| 69 63 65 20 69 73 20 69 | 6d 70 6c 65 6d 65 6e 74 |ice is i|mplement|
|000022b0| 65 64 20 69 6e 20 74 68 | 65 20 72 6f 75 74 69 6e |ed in th|e routin|
|000022c0| 65 20 49 73 47 57 6f 72 | 6c 64 50 74 72 28 77 69 |e IsGWor|ldPtr(wi|
|000022d0| 6e 64 6f 77 29 2e 0d 0d | 48 49 53 54 4f 52 59 3a |ndow)...|HISTORY:|
|000022e0| 0d 0d 31 32 2f 38 38 09 | 09 64 67 70 09 77 72 6f |..12/88.|.dgp.wro|
|000022f0| 74 65 20 69 74 0d 38 2f | 35 2f 38 39 09 09 09 61 |te it.8/|5/89...a|
|00002300| 64 64 65 64 20 63 61 6c | 6c 20 74 6f 20 47 44 55 |dded cal|l to GDU|
|00002310| 6e 63 6f 72 72 65 63 74 | 65 64 47 61 6d 6d 61 2c |ncorrect|edGamma,|
|00002320| 20 73 6f 20 49 20 63 6f | 75 6c 64 6e 27 74 20 66 | so I co|uldn't f|
|00002330| 6f 72 67 65 74 2e 0d 38 | 2f 31 35 2f 38 39 20 09 |orget..8|/15/89 .|
|00002340| 64 67 70 20 74 72 69 76 | 69 61 0d 33 2f 32 30 2f |dgp triv|ia.3/20/|
|00002350| 39 30 09 09 64 67 70 09 | 6d 61 6b 65 20 63 6f 6d |90..dgp.|make com|
|00002360| 70 61 74 69 62 6c 65 20 | 77 69 74 68 20 4d 50 57 |patible |with MPW|
|00002370| 20 43 2e 0d 33 2f 32 39 | 2f 39 30 09 09 64 67 70 | C..3/29|/90..dgp|
|00002380| 09 63 68 61 6e 67 65 64 | 20 64 65 63 6c 61 72 65 |.changed| declare|
|00002390| 64 20 72 65 74 75 72 6e | 65 64 20 74 79 70 65 20 |d return|ed type |
|000023a0| 66 72 6f 6d 20 57 69 6e | 64 6f 77 50 74 72 20 74 |from Win|dowPtr t|
|000023b0| 6f 20 43 57 69 6e 64 6f | 77 50 74 72 2c 20 77 68 |o CWindo|wPtr, wh|
|000023c0| 69 63 68 0d 09 09 09 09 | 69 73 20 77 68 61 74 20 |ich.....|is what |
|000023d0| 69 74 27 73 20 72 65 61 | 6c 6c 79 20 62 65 65 6e |it's rea|lly been|
|000023e0| 20 61 6c 6c 20 61 6c 6f | 6e 67 2e 20 53 61 6d 65 | all alo|ng. Same|
|000023f0| 20 63 68 61 6e 67 65 20 | 74 6f 20 61 72 67 75 6d | change |to argum|
|00002400| 65 6e 74 20 6f 66 0d 09 | 09 09 09 47 44 44 69 73 |ent of..|...GDDis|
|00002410| 70 6f 73 65 57 69 6e 64 | 6f 77 28 29 2e 20 54 68 |poseWind|ow(). Th|
|00002420| 65 20 6e 65 77 20 6f 66 | 66 73 63 72 65 65 6e 20 |e new of|fscreen |
|00002430| 47 57 6f 72 6c 64 20 63 | 61 6c 6c 73 20 66 6f 72 |GWorld c|alls for|
|00002440| 20 74 68 65 20 66 69 72 | 73 74 20 74 69 6d 65 0d | the fir|st time.|
|00002450| 09 09 09 09 6d 61 6b 65 | 20 69 74 20 65 61 73 69 |....make| it easi|
|00002460| 65 72 20 74 6f 20 68 6f | 6e 65 73 74 6c 79 20 64 |er to ho|nestly d|
|00002470| 65 63 6c 61 72 65 20 6f | 6e 65 27 73 20 77 69 6e |eclare o|ne's win|
|00002480| 64 6f 77 73 20 61 73 20 | 63 6f 6c 6f 72 20 72 61 |dows as |color ra|
|00002490| 74 68 65 72 0d 09 09 09 | 09 74 68 61 6e 20 70 72 |ther....|.than pr|
|000024a0| 65 74 65 6e 64 69 6e 67 | 20 74 68 65 79 27 72 65 |etending| they're|
|000024b0| 20 6e 6f 74 2e 0d 38 2f | 32 34 2f 39 31 09 09 64 | not..8/|24/91..d|
|000024c0| 67 70 09 4d 61 64 65 20 | 63 6f 6d 70 61 74 69 62 |gp.Made |compatib|
|000024d0| 6c 65 20 77 69 74 68 20 | 54 48 49 4e 4b 20 43 20 |le with |THINK C |
|000024e0| 35 2e 30 2e 0d 32 2f 31 | 2f 39 32 09 09 64 67 70 |5.0..2/1|/92..dgp|
|000024f0| 20 4d 61 64 65 20 6f 70 | 74 69 6f 6e 61 6c 20 74 | Made op|tional t|
|00002500| 68 65 20 64 65 76 69 63 | 65 20 61 72 67 75 6d 65 |he devic|e argume|
|00002510| 6e 74 20 74 6f 20 47 44 | 44 69 73 70 6f 73 65 57 |nt to GD|DisposeW|
|00002520| 69 6e 64 6f 77 28 29 2e | 20 49 66 20 69 74 27 73 |indow().| If it's|
|00002530| 0d 09 09 09 09 4e 55 4c | 4c 2c 20 74 68 65 6e 20 |.....NUL|L, then |
|00002540| 69 74 20 77 69 6c 6c 20 | 62 65 20 64 65 74 65 72 |it will |be deter|
|00002550| 6d 69 6e 65 64 20 61 75 | 74 6f 6d 61 74 69 63 61 |mined au|tomatica|
|00002560| 6c 6c 79 20 66 72 6f 6d | 20 77 69 6e 64 6f 77 2e |lly from| window.|
|00002570| 0d 32 2f 33 2f 39 33 09 | 09 64 68 62 09 45 78 74 |.2/3/93.|.dhb.Ext|
|00002580| 72 61 63 74 65 64 20 41 | 64 64 45 78 70 6c 69 63 |racted A|ddExplic|
|00002590| 69 74 50 61 6c 65 74 74 | 65 20 66 72 6f 6d 20 47 |itPalett|e from G|
|000025a0| 44 4f 70 65 6e 57 69 6e | 64 6f 77 2e 0d 32 2f 32 |DOpenWin|dow..2/2|
|000025b0| 31 2f 39 33 09 09 64 67 | 70 09 48 69 64 65 4d 65 |1/93..dg|p.HideMe|
|000025c0| 6e 75 42 61 72 20 69 66 | 20 77 69 6e 64 6f 77 20 |nuBar if| window |
|000025d0| 69 73 20 6f 6e 20 6d 61 | 69 6e 20 73 63 72 65 65 |is on ma|in scree|
|000025e0| 6e 2e 0d 32 2f 32 33 2f | 39 33 09 09 64 67 70 20 |n..2/23/|93..dgp |
|000025f0| 41 64 64 45 78 70 6c 69 | 63 69 74 50 61 6c 65 74 |AddExpli|citPalet|
|00002600| 74 65 28 29 20 72 65 74 | 75 72 6e 73 20 69 6d 6d |te() ret|urns imm|
|00002610| 65 64 69 61 74 65 6c 79 | 20 75 6e 6c 65 73 73 20 |ediately| unless |
|00002620| 69 74 20 72 65 63 65 69 | 76 65 73 20 61 20 63 6f |it recei|ves a co|
|00002630| 6c 6f 72 20 0d 09 09 09 | 09 77 69 6e 64 6f 77 2e |lor ....|.window.|
|00002640| 0d 09 09 09 09 41 64 64 | 65 64 20 47 44 4f 70 65 |.....Add|ed GDOpe|
|00002650| 6e 57 69 6e 64 6f 77 31 | 28 29 20 61 6e 64 20 47 |nWindow1|() and G|
|00002660| 44 44 69 73 70 6f 73 65 | 57 69 6e 64 6f 77 31 28 |DDispose|Window1(|
|00002670| 29 2c 20 77 68 69 63 68 | 20 62 6f 74 68 20 75 73 |), which| both us|
|00002680| 65 0d 09 09 09 09 61 20 | 57 69 6e 64 6f 77 50 74 |e.....a |WindowPt|
|00002690| 72 2c 20 69 6e 73 74 65 | 61 64 20 6f 66 20 61 20 |r, inste|ad of a |
|000026a0| 6c 65 73 73 20 63 6f 6e | 76 65 6e 69 65 6e 74 20 |less con|venient |
|000026b0| 43 57 69 6e 64 6f 77 50 | 74 72 2e 0d 33 2f 35 2f |CWindowP|tr..3/5/|
|000026c0| 39 33 09 09 64 67 70 09 | 41 64 64 65 64 20 63 61 |93..dgp.|Added ca|
|000026d0| 6c 6c 73 20 74 6f 20 55 | 6e 63 6c 69 70 53 63 72 |lls to U|nclipScr|
|000026e0| 65 65 6e 28 29 20 61 6e | 64 20 52 65 73 74 6f 72 |een() an|d Restor|
|000026f0| 65 53 63 72 65 65 6e 43 | 6c 69 70 70 69 6e 67 28 |eScreenC|lipping(|
|00002700| 29 2c 20 73 6f 20 74 68 | 65 20 77 69 6e 64 6f 77 |), so th|e window|
|00002710| 0d 09 09 09 09 6e 6f 77 | 20 74 72 75 6c 79 20 66 |.....now| truly f|
|00002720| 69 6c 6c 73 20 74 68 65 | 20 77 68 6f 6c 65 20 73 |ills the| whole s|
|00002730| 63 72 65 65 6e 2e 20 45 | 64 69 74 65 64 20 47 44 |creen. E|dited GD|
|00002740| 4f 70 65 6e 57 69 6e 64 | 6f 77 28 29 20 66 6f 72 |OpenWind|ow() for|
|00002750| 20 63 6c 61 72 69 74 79 | 2e 0d 33 2f 37 2f 38 33 | clarity|..3/7/83|
|00002760| 09 09 64 67 70 09 41 64 | 64 65 64 20 63 61 6c 6c |..dgp.Ad|ded call|
|00002770| 73 20 74 6f 20 47 44 53 | 61 76 65 47 61 6d 6d 61 |s to GDS|aveGamma|
|00002780| 28 64 65 76 69 63 65 29 | 20 61 6e 64 20 47 44 52 |(device)| and GDR|
|00002790| 65 73 74 6f 72 65 47 61 | 6d 6d 61 28 64 65 76 69 |estoreGa|mma(devi|
|000027a0| 63 65 29 2e 0d 34 2f 31 | 36 2f 39 33 09 09 64 67 |ce)..4/1|6/93..dg|
|000027b0| 70 09 43 6f 73 6d 65 74 | 69 63 20 65 64 69 74 69 |p.Cosmet|ic editi|
|000027c0| 6e 67 2e 0d 35 2f 32 32 | 2f 39 33 09 09 64 67 70 |ng..5/22|/93..dgp|
|000027d0| 09 41 64 64 65 64 20 52 | 65 6d 6f 76 65 50 61 6c |.Added R|emovePal|
|000027e0| 65 74 74 65 28 29 2c 20 | 62 75 74 20 64 69 64 6e |ette(), |but didn|
|000027f0| 27 74 20 74 65 73 74 20 | 69 74 2e 0d 31 2f 32 37 |'t test |it..1/27|
|00002800| 2f 39 34 09 09 64 67 70 | 09 43 6f 73 6d 65 74 69 |/94..dgp|.Cosmeti|
|00002810| 63 20 65 64 69 74 69 6e | 67 2e 0d 33 2f 35 2f 39 |c editin|g..3/5/9|
|00002820| 34 09 09 64 67 70 09 44 | 65 63 69 64 65 64 20 74 |4..dgp.D|ecided t|
|00002830| 68 61 74 20 52 65 6d 6f | 76 65 50 61 6c 65 74 74 |hat Remo|vePalett|
|00002840| 65 28 29 20 77 6f 72 6b | 73 20 66 69 6e 65 20 6e |e() work|s fine n|
|00002850| 6f 77 2e 0d 36 2f 38 2f | 39 34 09 09 64 67 70 20 |ow..6/8/|94..dgp |
|00002860| 41 64 64 45 78 70 6c 69 | 63 69 74 50 61 6c 65 74 |AddExpli|citPalet|
|00002870| 74 65 20 6e 6f 77 20 63 | 61 6c 6c 73 20 74 68 65 |te now c|alls the|
|00002880| 20 6e 65 77 20 4d 61 6b | 65 43 6f 6c 6f 72 54 61 | new Mak|eColorTa|
|00002890| 62 6c 65 45 78 70 6c 69 | 63 69 74 28 29 2c 20 77 |bleExpli|cit(), w|
|000028a0| 68 69 63 68 0d 09 09 09 | 09 73 65 74 73 20 74 68 |hich....|.sets th|
|000028b0| 65 20 43 6f 6c 6f 72 20 | 54 61 62 6c 65 20 63 74 |e Color |Table ct|
|000028c0| 46 6c 61 67 73 20 74 6f | 20 69 6e 64 69 63 61 74 |Flags to| indicat|
|000028d0| 65 20 74 68 61 74 0d 09 | 09 09 09 74 68 65 20 43 |e that..|...the C|
|000028e0| 6f 6c 6f 72 20 54 61 62 | 6c 65 20 72 65 66 65 72 |olor Tab|le refer|
|000028f0| 73 20 65 78 70 6c 69 63 | 69 74 6c 79 0d 09 09 09 |s explic|itly....|
|00002900| 09 74 6f 20 74 68 65 20 | 65 78 70 6c 69 63 69 74 |.to the |explicit|
|00002910| 20 70 61 6c 65 74 74 65 | 2e 20 54 68 69 73 20 74 | palette|. This t|
|00002920| 65 6c 6c 73 20 43 6f 70 | 79 42 69 74 73 20 74 6f |ells Cop|yBits to|
|00002930| 20 74 72 65 61 74 0d 09 | 09 09 09 74 68 65 20 70 | treat..|...the p|
|00002940| 69 78 65 6c 73 20 61 73 | 20 6e 75 6d 62 65 72 73 |ixels as| numbers|
|00002950| 2c 20 6e 6f 74 20 69 6e | 64 69 63 65 73 2e 0d 36 |, not in|dices..6|
|00002960| 2f 31 33 2f 39 34 09 09 | 64 67 70 20 49 6e 20 72 |/13/94..|dgp In r|
|00002970| 65 73 70 6f 6e 73 65 20 | 74 6f 20 71 75 65 72 79 |esponse |to query|
|00002980| 20 62 79 20 44 61 76 69 | 64 20 42 72 61 69 6e 61 | by Davi|d Braina|
|00002990| 72 64 20 49 20 6e 6f 77 | 20 64 6f 63 75 6d 65 6e |rd I now| documen|
|000029a0| 74 20 61 62 6f 76 65 0d | 09 09 09 09 74 68 65 20 |t above.|....the |
|000029b0| 6f 62 73 63 75 72 65 20 | 66 61 63 74 20 74 68 61 |obscure |fact tha|
|000029c0| 74 20 47 44 4f 70 65 6e | 57 69 6e 64 6f 77 27 73 |t GDOpen|Window's|
|000029d0| 20 66 72 61 6d 65 20 77 | 69 6c 6c 20 61 70 70 65 | frame w|ill appe|
|000029e0| 61 72 20 6f 6e 0d 09 09 | 09 09 6f 74 68 65 72 20 |ar on...|..other |
|000029f0| 73 63 72 65 65 6e 73 20 | 74 68 61 74 20 61 72 65 |screens |that are|
|00002a00| 20 63 6f 6e 74 69 67 75 | 6f 75 73 20 70 61 72 74 | contigu|ous part|
|00002a10| 73 20 6f 66 20 74 68 65 | 20 64 65 73 6b 74 6f 70 |s of the| desktop|
|00002a20| 2e 0d 38 2f 31 31 2f 39 | 34 20 64 68 62 20 26 20 |..8/11/9|4 dhb & |
|00002a30| 64 67 70 20 44 61 76 69 | 64 20 42 72 61 69 6e 61 |dgp Davi|d Braina|
|00002a40| 72 64 20 64 69 73 63 6f | 76 65 72 65 64 20 74 68 |rd disco|vered th|
|00002a50| 61 74 20 4d 61 6b 65 43 | 6f 6c 6f 72 54 61 62 6c |at MakeC|olorTabl|
|00002a60| 65 45 78 70 6c 69 63 69 | 74 28 29 2c 20 77 68 69 |eExplici|t(), whi|
|00002a70| 63 68 0d 09 09 09 09 69 | 73 20 63 61 6c 6c 65 64 |ch.....i|s called|
|00002a80| 20 62 79 20 41 64 64 45 | 78 70 6c 69 63 69 74 50 | by AddE|xplicitP|
|00002a90| 61 6c 65 74 74 65 2c 20 | 77 68 69 63 68 20 69 73 |alette, |which is|
|00002aa0| 20 63 61 6c 6c 65 64 20 | 62 79 20 47 44 4f 70 65 | called |by GDOpe|
|00002ab0| 6e 57 69 6e 64 6f 77 31 | 2c 20 77 61 73 20 61 66 |nWindow1|, was af|
|00002ac0| 66 65 63 74 69 6e 67 0d | 09 09 09 09 6e 6f 74 20 |fecting.|....not |
|00002ad0| 6a 75 73 74 20 74 68 65 | 20 6e 65 77 20 77 69 6e |just the| new win|
|00002ae0| 64 6f 77 27 73 20 63 6f | 6c 6f 72 20 74 61 62 6c |dow's co|lor tabl|
|00002af0| 65 2c 20 62 75 74 20 77 | 61 73 20 61 6c 73 6f 20 |e, but w|as also |
|00002b00| 61 66 66 65 63 74 69 6e | 67 20 74 68 65 20 64 65 |affectin|g the de|
|00002b10| 76 69 63 65 27 73 20 63 | 6f 6c 6f 72 0d 09 09 09 |vice's c|olor....|
|00002b20| 09 74 61 62 6c 65 20 28 | 62 65 63 61 75 73 65 20 |.table (|because |
|00002b30| 74 68 65 79 20 73 68 61 | 72 65 20 74 68 65 20 73 |they sha|re the s|
|00002b40| 61 6d 65 20 63 6f 6c 6f | 72 20 74 61 62 6c 65 29 |ame colo|r table)|
|00002b50| 2c 20 61 6e 64 20 74 68 | 61 74 20 74 68 65 20 64 |, and th|at the d|
|00002b60| 65 76 69 63 65 27 73 20 | 63 6f 6c 6f 72 0d 09 09 |evice's |color...|
|00002b70| 09 09 74 61 62 6c 65 20 | 77 61 73 20 6e 6f 74 20 |..table |was not |
|00002b80| 72 65 73 74 6f 72 65 64 | 2e 20 22 54 68 65 20 73 |restored|. "The s|
|00002b90| 79 6d 70 74 6f 6d 20 69 | 73 20 74 68 61 74 20 69 |ymptom i|s that i|
|00002ba0| 66 20 79 6f 75 20 73 75 | 62 73 65 71 75 65 6e 74 |f you su|bsequent|
|00002bb0| 6c 79 20 6c 61 75 6e 63 | 68 0d 09 09 09 09 4d 69 |ly launc|h.....Mi|
|00002bc0| 63 72 6f 73 6f 66 74 20 | 57 6f 72 64 2c 20 74 68 |crosoft |Word, th|
|00002bd0| 65 20 62 61 63 6b 67 72 | 6f 75 6e 64 20 6f 66 20 |e backgr|ound of |
|00002be0| 74 68 65 20 74 65 78 74 | 20 77 69 6e 64 6f 77 20 |the text| window |
|00002bf0| 74 61 6b 65 73 20 6f 6e | 20 61 20 73 74 72 61 6e |takes on| a stran|
|00002c00| 67 65 20 63 6f 6c 6f 72 | 0d 09 09 09 09 28 67 72 |ge color|.....(gr|
|00002c10| 65 79 29 20 69 6e 20 72 | 65 67 69 6f 6e 73 20 77 |ey) in r|egions w|
|00002c20| 68 65 72 65 20 74 68 65 | 72 65 20 69 73 20 74 65 |here the|re is te|
|00002c30| 78 74 2c 22 20 61 6e 64 | 20 74 68 65 20 70 72 6f |xt," and| the pro|
|00002c40| 62 6c 65 6d 20 70 65 72 | 73 69 73 74 73 20 75 6e |blem per|sists un|
|00002c50| 74 69 6c 20 72 65 62 6f | 6f 74 2e 0d 09 09 09 09 |til rebo|ot......|
|00002c60| 54 68 65 20 73 6f 6c 75 | 74 69 6f 6e 20 69 73 20 |The solu|tion is |
|00002c70| 74 6f 20 67 69 76 65 20 | 6f 75 72 20 77 69 6e 64 |to give |our wind|
|00002c80| 6f 77 20 69 74 73 20 6f | 77 6e 20 63 6f 6c 6f 72 |ow its o|wn color|
|00002c90| 20 74 61 62 6c 65 2c 20 | 77 68 69 63 68 20 77 65 | table, |which we|
|00002ca0| 20 63 61 6e 0d 09 09 09 | 09 73 61 66 65 6c 79 20 | can....|.safely |
|00002cb0| 6d 6f 64 69 66 79 2e 20 | 0d 38 2f 31 32 2f 39 34 |modify. |.8/12/94|
|00002cc0| 20 64 68 62 20 26 20 64 | 67 70 20 6f 6e 20 38 2f | dhb & d|gp on 8/|
|00002cd0| 31 31 20 64 65 6e 69 73 | 20 69 6e 61 64 76 65 72 |11 denis| inadver|
|00002ce0| 74 65 6e 74 6c 79 20 69 | 6e 74 72 6f 64 75 63 65 |tently i|ntroduce|
|00002cf0| 64 20 61 20 62 75 67 20 | 69 6e 74 6f 20 47 44 44 |d a bug |into GDD|
|00002d00| 69 73 70 6f 73 65 57 69 | 6e 64 6f 77 31 2c 20 0d |isposeWi|ndow1, .|
|00002d10| 09 09 09 09 6d 6f 76 69 | 6e 67 20 74 68 65 20 63 |....movi|ng the c|
|00002d20| 61 6c 6c 20 74 6f 20 47 | 65 74 57 69 6e 64 6f 77 |all to G|etWindow|
|00002d30| 44 65 76 69 63 65 28 29 | 20 74 6f 20 61 20 70 6f |Device()| to a po|
|00002d40| 69 6e 74 20 61 66 74 65 | 72 20 74 68 65 20 77 69 |int afte|r the wi|
|00002d50| 6e 64 6f 77 0d 09 09 09 | 09 77 61 73 20 64 69 73 |ndow....|.was dis|
|00002d60| 70 6f 73 65 64 20 6f 66 | 2e 20 44 61 76 69 64 20 |posed of|. David |
|00002d70| 66 69 78 65 64 20 69 74 | 2c 20 6d 6f 76 69 6e 67 |fixed it|, moving|
|00002d80| 20 74 68 65 20 63 61 6c | 6c 20 62 61 63 6b 20 77 | the cal|l back w|
|00002d90| 68 65 72 65 20 69 74 20 | 62 65 6c 6f 6e 67 65 64 |here it |belonged|
|00002da0| 2e 0d 38 2f 31 34 2f 39 | 34 09 64 67 70 09 09 47 |..8/14/9|4.dgp..G|
|00002db0| 44 4f 70 65 6e 57 69 6e | 64 6f 77 31 20 6e 6f 77 |DOpenWin|dow1 now|
|00002dc0| 20 67 65 74 73 20 74 68 | 65 20 63 6f 6c 6f 72 20 | gets th|e color |
|00002dd0| 74 61 62 6c 65 20 66 72 | 6f 6d 20 74 68 65 20 77 |table fr|om the w|
|00002de0| 69 6e 64 6f 77 27 73 20 | 64 65 76 69 63 65 20 69 |indow's |device i|
|00002df0| 6e 73 74 65 61 64 0d 09 | 09 09 09 6f 66 20 74 68 |nstead..|...of th|
|00002e00| 65 20 6d 61 69 6e 20 64 | 65 76 69 63 65 2e 0d 38 |e main d|evice..8|
|00002e10| 2f 31 37 2f 39 34 09 09 | 64 67 70 20 6d 61 6b 65 |/17/94..|dgp make|
|00002e20| 20 63 6f 6c 6f 72 20 74 | 61 62 6c 65 20 4e 4f 54 | color t|able NOT|
|00002e30| 20 65 78 70 6c 69 63 69 | 74 20 77 68 65 6e 20 47 | explici|t when G|
|00002e40| 44 44 69 73 70 6f 73 65 | 57 69 6e 64 6f 77 31 20 |DDispose|Window1 |
|00002e50| 69 73 20 63 61 6c 6c 65 | 64 2e 0d 39 2f 35 2f 39 |is calle|d..9/5/9|
|00002e60| 34 20 09 09 64 67 70 20 | 72 65 6d 6f 76 65 64 20 |4 ..dgp |removed |
|00002e70| 61 73 73 75 6d 70 74 69 | 6f 6e 20 69 6e 20 70 72 |assumpti|on in pr|
|00002e80| 69 6e 74 66 27 73 20 74 | 68 61 74 20 69 6e 74 3d |intf's t|hat int=|
|00002e90| 3d 73 68 6f 72 74 2e 0d | 31 30 2f 31 30 2f 39 34 |=short..|10/10/94|
|00002ea0| 09 09 64 67 70 20 47 44 | 4f 70 65 6e 57 69 6e 64 |..dgp GD|OpenWind|
|00002eb0| 6f 77 31 20 6e 6f 77 20 | 61 73 73 6f 63 69 61 74 |ow1 now |associat|
|00002ec0| 65 73 20 63 6f 72 72 65 | 63 74 20 64 65 76 69 63 |es corre|ct devic|
|00002ed0| 65 27 73 20 63 6f 6c 6f | 72 20 74 61 62 6c 65 20 |e's colo|r table |
|00002ee0| 77 69 74 68 20 77 69 6e | 64 6f 77 2c 0d 09 09 09 |with win|dow,....|
|00002ef0| 09 6e 6f 74 20 4d 61 69 | 6e 44 65 76 69 63 65 27 |.not Mai|nDevice'|
|00002f00| 73 2e 0d 31 30 2f 32 34 | 2f 39 34 09 64 67 70 20 |s..10/24|/94.dgp |
|00002f10| 47 44 4f 70 65 6e 57 69 | 6e 64 6f 77 31 20 72 65 |GDOpenWi|ndow1 re|
|00002f20| 74 75 72 6e 73 20 4e 55 | 4c 4c 20 69 66 20 74 68 |turns NU|LL if th|
|00002f30| 65 72 65 27 73 20 6e 6f | 20 64 72 69 76 65 72 20 |ere's no| driver |
|00002f40| 61 73 73 6f 63 69 61 74 | 65 64 20 77 69 74 68 20 |associat|ed with |
|00002f50| 74 68 65 20 64 65 76 69 | 63 65 2e 0d 31 30 2f 32 |the devi|ce..10/2|
|00002f60| 35 2f 39 34 09 64 67 70 | 20 41 64 64 65 64 20 47 |5/94.dgp| Added G|
|00002f70| 44 47 72 61 79 43 6f 6c | 6f 72 54 61 62 6c 65 28 |DGrayCol|orTable(|
|00002f80| 64 65 76 69 63 65 29 2c | 20 77 68 69 63 68 20 67 |device),| which g|
|00002f90| 69 76 65 73 20 74 68 65 | 20 64 65 76 69 63 65 20 |ives the| device |
|00002fa0| 61 20 73 74 61 6e 64 61 | 72 64 20 67 72 61 79 20 |a standa|rd gray |
|00002fb0| 63 6f 6c 6f 72 20 74 61 | 62 6c 65 2e 0d 31 31 2f |color ta|ble..11/|
|00002fc0| 32 2f 39 34 09 09 64 67 | 70 20 4c 65 61 76 65 20 |2/94..dg|p Leave |
|00002fd0| 74 68 65 20 65 78 70 6c | 69 63 69 74 20 62 69 74 |the expl|icit bit|
|00002fe0| 20 61 6c 6f 6e 65 2e 20 | 46 6f 72 20 74 68 65 20 | alone. |For the |
|00002ff0| 61 64 76 65 6e 74 75 72 | 6f 75 73 20 49 20 70 72 |adventur|ous I pr|
|00003000| 6f 76 69 64 65 20 74 68 | 65 20 0d 09 09 09 09 4d |ovide th|e .....M|
|00003010| 61 6b 65 43 6f 6c 6f 72 | 54 61 62 6c 65 45 78 70 |akeColor|TableExp|
|00003020| 6c 69 63 69 74 28 29 20 | 72 6f 75 74 69 6e 65 20 |licit() |routine |
|00003030| 61 6e 64 20 64 6f 63 75 | 6d 65 6e 74 61 74 69 6f |and docu|mentatio|
|00003040| 6e 20 69 6e 20 0d 09 09 | 09 09 56 69 64 65 6f 54 |n in ...|..VideoT|
|00003050| 6f 6f 6c 62 6f 78 3a 4e | 6f 74 65 73 3a 22 43 6f |oolbox:N|otes:"Co|
|00003060| 70 79 42 69 74 73 20 73 | 6c 61 76 69 73 68 6c 79 |pyBits s|lavishly|
|00003070| 22 2e 0d 31 31 2f 31 37 | 2f 39 34 09 64 67 70 09 |"..11/17|/94.dgp.|
|00003080| 72 65 6e 61 6d 65 64 20 | 49 73 57 69 6e 64 6f 77 |renamed |IsWindow|
|00003090| 20 74 6f 20 49 73 47 72 | 61 66 50 74 72 2e 20 52 | to IsGr|afPtr. R|
|000030a0| 65 6e 61 6d 65 64 20 49 | 73 4f 66 66 53 63 72 65 |enamed I|sOffScre|
|000030b0| 65 6e 20 74 6f 20 49 73 | 47 57 6f 72 6c 64 50 74 |en to Is|GWorldPt|
|000030c0| 72 2e 0d 34 2f 31 31 2f | 39 35 09 09 64 67 70 20 |r..4/11/|95..dgp |
|000030d0| 46 69 78 65 64 20 61 73 | 73 65 72 74 69 6f 6e 20 |Fixed as|sertion |
|000030e0| 66 61 69 6c 75 72 65 20 | 69 6e 20 47 44 47 72 61 |failure |in GDGra|
|000030f0| 79 57 69 6e 64 6f 77 3b | 20 74 68 65 20 72 73 72 |yWindow;| the rsr|
|00003100| 63 20 69 64 20 6f 66 20 | 74 68 65 20 32 2d 62 69 |c id of |the 2-bi|
|00003110| 74 20 67 72 61 79 20 72 | 61 6d 70 20 69 73 20 32 |t gray r|amp is 2|
|00003120| 2c 0d 09 09 09 09 6e 6f | 74 20 33 32 2b 32 2e 0d |,.....no|t 32+2..|
|00003130| 34 2f 31 31 2f 39 35 09 | 64 67 70 09 09 74 72 61 |4/11/95.|dgp..tra|
|00003140| 6e 73 66 65 72 72 65 64 | 20 73 6f 6d 65 20 64 6f |nsferred| some do|
|00003150| 63 75 6d 65 6e 74 61 74 | 69 6f 6e 20 6f 66 20 49 |cumentat|ion of I|
|00003160| 73 47 57 6f 72 6c 64 50 | 74 72 20 66 72 6f 6d 20 |sGWorldP|tr from |
|00003170| 47 65 74 53 63 72 65 65 | 6e 44 65 76 69 63 65 2e |GetScree|nDevice.|
|00003180| 63 20 74 6f 20 61 62 6f | 76 65 2e 0d 2a 2f 0d 23 |c to abo|ve..*/.#|
|00003190| 69 6e 63 6c 75 64 65 20 | 22 56 69 64 65 6f 54 6f |include |"VideoTo|
|000031a0| 6f 6c 62 6f 78 2e 68 22 | 0d 23 69 6e 63 6c 75 64 |olbox.h"|.#includ|
|000031b0| 65 20 3c 61 73 73 65 72 | 74 2e 68 3e 0d 0d 23 64 |e <asser|t.h>..#d|
|000031c0| 65 66 69 6e 65 20 4d 41 | 4b 45 5f 43 4f 4c 4f 52 |efine MA|KE_COLOR|
|000031d0| 5f 54 41 42 4c 45 20 30 | 0d 0d 57 69 6e 64 6f 77 |_TABLE 0|..Window|
|000031e0| 50 74 72 20 47 44 4f 70 | 65 6e 57 69 6e 64 6f 77 |Ptr GDOp|enWindow|
|000031f0| 31 28 47 44 48 61 6e 64 | 6c 65 20 64 65 76 69 63 |1(GDHand|le devic|
|00003200| 65 29 0d 7b 0d 09 72 65 | 74 75 72 6e 20 28 57 69 |e).{..re|turn (Wi|
|00003210| 6e 64 6f 77 50 74 72 29 | 47 44 4f 70 65 6e 57 69 |ndowPtr)|GDOpenWi|
|00003220| 6e 64 6f 77 28 64 65 76 | 69 63 65 29 3b 0d 7d 0d |ndow(dev|ice);.}.|
|00003230| 0d 76 6f 69 64 20 47 44 | 44 69 73 70 6f 73 65 57 |.void GD|DisposeW|
|00003240| 69 6e 64 6f 77 31 28 57 | 69 6e 64 6f 77 50 74 72 |indow1(W|indowPtr|
|00003250| 20 77 69 6e 64 6f 77 29 | 0d 7b 0d 09 47 44 44 69 | window)|.{..GDDi|
|00003260| 73 70 6f 73 65 57 69 6e | 64 6f 77 28 28 43 57 69 |sposeWin|dow((CWi|
|00003270| 6e 64 6f 77 50 74 72 29 | 20 77 69 6e 64 6f 77 29 |ndowPtr)| window)|
|00003280| 3b 0d 7d 0d 0d 43 57 69 | 6e 64 6f 77 50 74 72 20 |;.}..CWi|ndowPtr |
|00003290| 47 44 4f 70 65 6e 57 69 | 6e 64 6f 77 28 47 44 48 |GDOpenWi|ndow(GDH|
|000032a0| 61 6e 64 6c 65 20 64 65 | 76 69 63 65 29 0d 7b 0d |andle de|vice).{.|
|000032b0| 09 43 57 69 6e 64 6f 77 | 50 74 72 20 77 69 6e 64 |.CWindow|Ptr wind|
|000032c0| 6f 77 3b 0d 09 52 65 63 | 74 20 72 3b 0d 09 47 44 |ow;..Rec|t r;..GD|
|000032d0| 48 61 6e 64 6c 65 20 6f | 6c 64 44 65 76 69 63 65 |Handle o|ldDevice|
|000032e0| 3b 0d 0d 09 69 66 28 64 | 65 76 69 63 65 3d 3d 4e |;...if(d|evice==N|
|000032f0| 55 4c 4c 20 7c 7c 20 28 | 2a 64 65 76 69 63 65 29 |ULL || (|*device)|
|00003300| 2d 3e 67 64 52 65 66 4e | 75 6d 3d 3d 30 29 72 65 |->gdRefN|um==0)re|
|00003310| 74 75 72 6e 20 4e 55 4c | 4c 3b 0d 09 72 3d 28 2a |turn NUL|L;..r=(*|
|00003320| 64 65 76 69 63 65 29 2d | 3e 67 64 52 65 63 74 3b |device)-|>gdRect;|
|00003330| 09 09 2f 2f 20 72 65 63 | 74 20 6f 66 20 64 65 73 |..// rec|t of des|
|00003340| 69 72 65 64 20 73 63 72 | 65 65 6e 20 69 6e 20 67 |ired scr|een in g|
|00003350| 6c 6f 62 61 6c 20 63 6f | 6f 72 64 69 6e 61 74 65 |lobal co|ordinate|
|00003360| 73 0d 09 47 44 53 61 76 | 65 47 61 6d 6d 61 28 64 |s..GDSav|eGamma(d|
|00003370| 65 76 69 63 65 29 3b 0d | 09 47 44 55 6e 63 6f 72 |evice);.|.GDUncor|
|00003380| 72 65 63 74 65 64 47 61 | 6d 6d 61 28 64 65 76 69 |rectedGa|mma(devi|
|00003390| 63 65 29 3b 0d 09 55 6e | 63 6c 69 70 53 63 72 65 |ce);..Un|clipScre|
|000033a0| 65 6e 28 64 65 76 69 63 | 65 29 3b 0d 09 47 44 47 |en(devic|e);..GDG|
|000033b0| 72 61 79 43 6f 6c 6f 72 | 54 61 62 6c 65 28 64 65 |rayColor|Table(de|
|000033c0| 76 69 63 65 29 3b 0d 09 | 6f 6c 64 44 65 76 69 63 |vice);..|oldDevic|
|000033d0| 65 3d 47 65 74 47 44 65 | 76 69 63 65 28 29 3b 0d |e=GetGDe|vice();.|
|000033e0| 09 53 65 74 47 44 65 76 | 69 63 65 28 47 65 74 4d |.SetGDev|ice(GetM|
|000033f0| 61 69 6e 44 65 76 69 63 | 65 28 29 29 3b 09 2f 2f |ainDevic|e());.//|
|00003400| 20 4e 65 65 64 65 64 20 | 66 6f 72 20 77 69 6e 64 | Needed |for wind|
|00003410| 6f 77 20 74 6f 20 77 6f | 72 6b 20 70 72 6f 70 65 |ow to wo|rk prope|
|00003420| 72 6c 79 2e 0d 09 77 69 | 6e 64 6f 77 3d 28 43 57 |rly...wi|ndow=(CW|
|00003430| 69 6e 64 6f 77 50 74 72 | 29 4e 65 77 43 57 69 6e |indowPtr|)NewCWin|
|00003440| 64 6f 77 28 4e 55 4c 4c | 2c 26 72 2c 22 5c 70 22 |dow(NULL|,&r,"\p"|
|00003450| 2c 54 52 55 45 2c 70 6c | 61 69 6e 44 42 6f 78 2c |,TRUE,pl|ainDBox,|
|00003460| 28 57 69 6e 64 6f 77 50 | 74 72 29 20 2d 31 4c 2c |(WindowP|tr) -1L,|
|00003470| 30 2c 31 32 33 4c 29 3b | 0d 09 28 2a 77 69 6e 64 |0,123L);|..(*wind|
|00003480| 6f 77 2d 3e 70 6f 72 74 | 50 69 78 4d 61 70 29 2d |ow->port|PixMap)-|
|00003490| 3e 70 6d 54 61 62 6c 65 | 3d 28 2a 2a 28 2a 2a 64 |>pmTable|=(**(**d|
|000034a0| 65 76 69 63 65 29 2e 67 | 64 50 4d 61 70 29 2e 70 |evice).g|dPMap).p|
|000034b0| 6d 54 61 62 6c 65 3b 0d | 09 53 65 74 47 44 65 76 |mTable;.|.SetGDev|
|000034c0| 69 63 65 28 6f 6c 64 44 | 65 76 69 63 65 29 3b 0d |ice(oldD|evice);.|
|000034d0| 09 41 64 64 45 78 70 6c | 69 63 69 74 50 61 6c 65 |.AddExpl|icitPale|
|000034e0| 74 74 65 28 28 57 69 6e | 64 6f 77 50 74 72 29 77 |tte((Win|dowPtr)w|
|000034f0| 69 6e 64 6f 77 29 3b 0d | 09 72 65 74 75 72 6e 20 |indow);.|.return |
|00003500| 77 69 6e 64 6f 77 3b 0d | 7d 0d 0d 76 6f 69 64 20 |window;.|}..void |
|00003510| 47 44 47 72 61 79 43 6f | 6c 6f 72 54 61 62 6c 65 |GDGrayCo|lorTable|
|00003520| 28 47 44 48 61 6e 64 6c | 65 20 64 65 76 69 63 65 |(GDHandl|e device|
|00003530| 29 0d 2f 2f 20 67 69 76 | 65 20 74 68 65 20 64 65 |).// giv|e the de|
|00003540| 76 69 63 65 20 61 20 73 | 74 61 6e 64 61 72 64 20 |vice a s|tandard |
|00003550| 67 72 61 79 20 63 6f 6c | 6f 72 20 74 61 62 6c 65 |gray col|or table|
|00003560| 0d 7b 0d 09 43 6f 6c 6f | 72 54 61 62 6c 65 20 2a |.{..Colo|rTable *|
|00003570| 2a 74 61 62 6c 65 3b 0d | 09 50 69 78 4d 61 70 20 |*table;.|.PixMap |
|00003580| 2a 2a 70 6d 3b 0d 09 69 | 6e 74 20 69 64 3b 0d 0d |**pm;..i|nt id;..|
|00003590| 09 69 66 28 64 65 76 69 | 63 65 3d 3d 4e 55 4c 4c |.if(devi|ce==NULL|
|000035a0| 29 72 65 74 75 72 6e 3b | 0d 09 70 6d 3d 28 2a 2a |)return;|..pm=(**|
|000035b0| 64 65 76 69 63 65 29 2e | 67 64 50 4d 61 70 3b 0d |device).|gdPMap;.|
|000035c0| 09 74 61 62 6c 65 3d 28 | 2a 2a 70 6d 29 2e 70 6d |.table=(|**pm).pm|
|000035d0| 54 61 62 6c 65 3b 0d 09 | 69 64 3d 28 2a 2a 70 6d |Table;..|id=(**pm|
|000035e0| 29 2e 70 69 78 65 6c 53 | 69 7a 65 3b 0d 09 69 66 |).pixelS|ize;..if|
|000035f0| 28 69 64 3e 32 29 69 64 | 2b 3d 33 32 3b 0d 09 69 |(id>2)id|+=32;..i|
|00003600| 66 28 28 2a 2a 64 65 76 | 69 63 65 29 2e 67 64 54 |f((**dev|ice).gdT|
|00003610| 79 70 65 3d 3d 63 6c 75 | 74 54 79 70 65 20 26 26 |ype==clu|tType &&|
|00003620| 20 28 2a 2a 74 61 62 6c | 65 29 2e 63 74 53 65 65 | (**tabl|e).ctSee|
|00003630| 64 21 3d 69 64 29 7b 0d | 09 09 2f 2f 20 47 69 76 |d!=id){.|..// Giv|
|00003640| 65 20 74 68 65 20 64 65 | 76 69 63 65 20 61 20 73 |e the de|vice a s|
|00003650| 74 61 6e 64 61 72 64 20 | 67 72 61 79 2d 72 61 6d |tandard |gray-ram|
|00003660| 70 20 63 6f 6c 6f 72 20 | 74 61 62 6c 65 0d 09 09 |p color |table...|
|00003670| 74 61 62 6c 65 3d 47 65 | 74 43 54 61 62 6c 65 28 |table=Ge|tCTable(|
|00003680| 69 64 29 3b 09 2f 2f 20 | 67 72 61 79 20 72 61 6d |id);.// |gray ram|
|00003690| 70 0d 09 09 61 73 73 65 | 72 74 28 28 2a 2a 74 61 |p...asse|rt((**ta|
|000036a0| 62 6c 65 29 2e 63 74 53 | 65 65 64 3d 3d 69 64 29 |ble).ctS|eed==id)|
|000036b0| 3b 0d 09 09 61 73 73 65 | 72 74 28 74 61 62 6c 65 |;...asse|rt(table|
|000036c0| 21 3d 4e 55 4c 4c 29 3b | 0d 09 09 61 73 73 65 72 |!=NULL);|...asser|
|000036d0| 74 28 28 2a 2a 28 2a 2a | 70 6d 29 2e 70 6d 54 61 |t((**(**|pm).pmTa|
|000036e0| 62 6c 65 29 2e 63 74 53 | 69 7a 65 3d 3d 28 2a 2a |ble).ctS|ize==(**|
|000036f0| 74 61 62 6c 65 29 2e 63 | 74 53 69 7a 65 29 3b 0d |table).c|tSize);.|
|00003700| 09 09 6d 65 6d 63 70 79 | 28 2a 28 2a 2a 70 6d 29 |..memcpy|(*(**pm)|
|00003710| 2e 70 6d 54 61 62 6c 65 | 2c 2a 74 61 62 6c 65 2c |.pmTable|,*table,|
|00003720| 38 2b 28 28 2a 2a 74 61 | 62 6c 65 29 2e 63 74 53 |8+((**ta|ble).ctS|
|00003730| 69 7a 65 2b 31 29 2a 73 | 69 7a 65 6f 66 28 43 6f |ize+1)*s|izeof(Co|
|00003740| 6c 6f 72 53 70 65 63 29 | 29 3b 0d 09 09 44 69 73 |lorSpec)|);...Dis|
|00003750| 70 6f 73 65 48 61 6e 64 | 6c 65 28 28 48 61 6e 64 |poseHand|le((Hand|
|00003760| 6c 65 29 74 61 62 6c 65 | 29 3b 0d 09 09 74 61 62 |le)table|);...tab|
|00003770| 6c 65 3d 28 2a 2a 70 6d | 29 2e 70 6d 54 61 62 6c |le=(**pm|).pmTabl|
|00003780| 65 3b 0d 09 09 28 2a 2a | 74 61 62 6c 65 29 2e 63 |e;...(**|table).c|
|00003790| 74 46 6c 61 67 73 7c 3d | 30 78 38 30 30 30 3b 09 |tFlags|=|0x8000;.|
|000037a0| 2f 2f 20 6d 61 72 6b 20 | 61 73 20 62 65 6c 6f 6e |// mark |as belon|
|000037b0| 67 69 6e 67 20 74 6f 20 | 61 20 64 65 76 69 63 65 |ging to |a device|
|000037c0| 0d 09 09 47 44 65 76 69 | 63 65 43 68 61 6e 67 65 |...GDevi|ceChange|
|000037d0| 64 28 64 65 76 69 63 65 | 29 3b 0d 09 09 61 73 73 |d(device|);...ass|
|000037e0| 65 72 74 28 28 2a 2a 74 | 61 62 6c 65 29 2e 63 74 |ert((**t|able).ct|
|000037f0| 53 65 65 64 3d 3d 69 64 | 29 3b 0d 09 7d 0d 7d 0d |Seed==id|);..}.}.|
|00003800| 0d 76 6f 69 64 20 47 44 | 44 69 73 70 6f 73 65 57 |.void GD|DisposeW|
|00003810| 69 6e 64 6f 77 28 43 57 | 69 6e 64 6f 77 50 74 72 |indow(CW|indowPtr|
|00003820| 20 77 69 6e 64 6f 77 29 | 0d 2f 2f 20 44 69 73 70 | window)|.// Disp|
|00003830| 6f 73 65 20 6f 66 20 77 | 69 6e 64 6f 77 20 61 6e |ose of w|indow an|
|00003840| 64 20 70 61 6c 65 74 74 | 65 20 61 6e 64 20 72 65 |d palett|e and re|
|00003850| 73 74 6f 72 65 20 74 68 | 65 20 63 6f 6c 6f 72 20 |store th|e color |
|00003860| 74 61 62 6c 65 20 61 6e | 64 20 63 6c 75 74 2e 0d |table an|d clut..|
|00003870| 7b 0d 09 47 44 48 61 6e | 64 6c 65 20 64 65 76 69 |{..GDHan|dle devi|
|00003880| 63 65 3b 0d 09 0d 09 69 | 66 28 77 69 6e 64 6f 77 |ce;....i|f(window|
|00003890| 3d 3d 4e 55 4c 4c 29 72 | 65 74 75 72 6e 3b 0d 09 |==NULL)r|eturn;..|
|000038a0| 52 65 6d 6f 76 65 50 61 | 6c 65 74 74 65 28 28 57 |RemovePa|lette((W|
|000038b0| 69 6e 64 6f 77 50 74 72 | 29 77 69 6e 64 6f 77 29 |indowPtr|)window)|
|000038c0| 3b 0d 09 23 69 66 20 4d | 41 4b 45 5f 43 4f 4c 4f |;..#if M|AKE_COLO|
|000038d0| 52 5f 54 41 42 4c 45 0d | 09 09 44 69 73 70 6f 73 |R_TABLE.|..Dispos|
|000038e0| 48 61 6e 64 6c 65 28 28 | 48 61 6e 64 6c 65 29 28 |Handle((|Handle)(|
|000038f0| 2a 28 28 43 47 72 61 66 | 50 74 72 29 77 69 6e 64 |*((CGraf|Ptr)wind|
|00003900| 6f 77 29 2d 3e 70 6f 72 | 74 50 69 78 4d 61 70 29 |ow)->por|tPixMap)|
|00003910| 2d 3e 70 6d 54 61 62 6c | 65 29 3b 0d 09 23 65 6e |->pmTabl|e);..#en|
|00003920| 64 69 66 0d 09 64 65 76 | 69 63 65 3d 47 65 74 57 |dif..dev|ice=GetW|
|00003930| 69 6e 64 6f 77 44 65 76 | 69 63 65 28 28 57 69 6e |indowDev|ice((Win|
|00003940| 64 6f 77 50 74 72 29 77 | 69 6e 64 6f 77 29 3b 0d |dowPtr)w|indow);.|
|00003950| 09 44 69 73 70 6f 73 65 | 57 69 6e 64 6f 77 28 28 |.Dispose|Window((|
|00003960| 57 69 6e 64 6f 77 50 74 | 72 29 77 69 6e 64 6f 77 |WindowPt|r)window|
|00003970| 29 3b 0d 09 69 66 28 64 | 65 76 69 63 65 3d 3d 4e |);..if(d|evice==N|
|00003980| 55 4c 4c 29 72 65 74 75 | 72 6e 3b 0d 09 47 44 52 |ULL)retu|rn;..GDR|
|00003990| 65 73 74 6f 72 65 47 61 | 6d 6d 61 28 64 65 76 69 |estoreGa|mma(devi|
|000039a0| 63 65 29 3b 0d 09 47 44 | 52 65 73 74 6f 72 65 44 |ce);..GD|RestoreD|
|000039b0| 65 76 69 63 65 43 6c 75 | 74 28 64 65 76 69 63 65 |eviceClu|t(device|
|000039c0| 29 3b 0d 09 52 65 73 74 | 6f 72 65 53 63 72 65 65 |);..Rest|oreScree|
|000039d0| 6e 43 6c 69 70 70 69 6e | 67 28 64 65 76 69 63 65 |nClippin|g(device|
|000039e0| 29 3b 0d 7d 0d 0d 76 6f | 69 64 20 41 64 64 45 78 |);.}..vo|id AddEx|
|000039f0| 70 6c 69 63 69 74 50 61 | 6c 65 74 74 65 28 57 69 |plicitPa|lette(Wi|
|00003a00| 6e 64 6f 77 50 74 72 20 | 77 69 6e 64 6f 77 29 0d |ndowPtr |window).|
|00003a10| 2f 2f 20 43 72 65 61 74 | 65 20 61 20 70 61 6c 65 |// Creat|e a pale|
|00003a20| 74 74 65 20 66 6f 72 20 | 74 68 65 20 63 6f 6c 6f |tte for |the colo|
|00003a30| 72 20 77 69 6e 64 6f 77 | 20 61 6e 64 20 6d 61 72 |r window| and mar|
|00003a40| 6b 20 61 6c 6c 20 74 68 | 65 20 65 6e 74 72 69 65 |k all th|e entrie|
|00003a50| 73 20 61 73 20 65 78 70 | 6c 69 63 69 74 2e 0d 2f |s as exp|licit../|
|00003a60| 2f 20 43 6f 70 79 20 74 | 68 65 20 65 6e 74 72 69 |/ Copy t|he entri|
|00003a70| 65 73 20 66 72 6f 6d 20 | 74 68 65 20 77 69 6e 64 |es from |the wind|
|00003a80| 6f 77 27 73 20 64 65 76 | 69 63 65 2e 0d 7b 0d 09 |ow's dev|ice..{..|
|00003a90| 47 44 48 61 6e 64 6c 65 | 20 64 65 76 69 63 65 3b |GDHandle| device;|
|00003aa0| 0d 09 43 54 61 62 48 61 | 6e 64 6c 65 20 63 74 3b |..CTabHa|ndle ct;|
|00003ab0| 0d 09 50 61 6c 65 74 74 | 65 48 61 6e 64 6c 65 20 |..Palett|eHandle |
|00003ac0| 70 61 6c 65 74 74 65 3b | 0d 09 69 6e 74 20 63 6f |palette;|..int co|
|00003ad0| 6c 6f 72 73 3b 0d 09 23 | 69 66 20 4d 41 4b 45 5f |lors;..#|if MAKE_|
|00003ae0| 43 4f 4c 4f 52 5f 54 41 | 42 4c 45 0d 09 09 69 6e |COLOR_TA|BLE...in|
|00003af0| 74 20 69 2c 65 72 72 6f | 72 3b 0d 09 23 65 6e 64 |t i,erro|r;..#end|
|00003b00| 69 66 0d 0d 09 69 66 28 | 77 69 6e 64 6f 77 3d 3d |if...if(|window==|
|00003b10| 4e 55 4c 4c 29 72 65 74 | 75 72 6e 3b 0d 09 69 66 |NULL)ret|urn;..if|
|00003b20| 28 28 28 43 47 72 61 66 | 50 74 72 29 77 69 6e 64 |(((CGraf|Ptr)wind|
|00003b30| 6f 77 29 2d 3e 70 6f 72 | 74 56 65 72 73 69 6f 6e |ow)->por|tVersion|
|00003b40| 3e 3d 30 29 20 72 65 74 | 75 72 6e 3b 09 2f 2f 20 |>=0) ret|urn;.// |
|00003b50| 4e 6f 74 20 61 20 63 6f | 6c 6f 72 20 77 69 6e 64 |Not a co|lor wind|
|00003b60| 6f 77 2c 20 72 65 74 75 | 72 6e 2e 0d 09 64 65 76 |ow, retu|rn...dev|
|00003b70| 69 63 65 3d 47 65 74 57 | 69 6e 64 6f 77 44 65 76 |ice=GetW|indowDev|
|00003b80| 69 63 65 28 77 69 6e 64 | 6f 77 29 3b 0d 09 69 66 |ice(wind|ow);..if|
|00003b90| 28 64 65 76 69 63 65 3d | 3d 4e 55 4c 4c 29 50 72 |(device=|=NULL)Pr|
|00003ba0| 69 6e 74 66 45 78 69 74 | 28 0d 09 09 22 41 64 64 |intfExit|(..."Add|
|00003bb0| 45 78 70 6c 69 63 69 74 | 50 61 6c 65 74 74 65 3a |Explicit|Palette:|
|00003bc0| 20 77 69 6e 64 6f 77 20 | 68 61 73 20 6e 6f 20 64 | window |has no d|
|00003bd0| 65 76 69 63 65 21 20 25 | 73 20 6c 69 6e 65 20 25 |evice! %|s line %|
|00003be0| 64 2e 5c 6e 22 2c 5f 5f | 46 49 4c 45 5f 5f 2c 5f |d.\n",__|FILE__,_|
|00003bf0| 5f 4c 49 4e 45 5f 5f 29 | 3b 0d 09 63 74 3d 28 2a |_LINE__)|;..ct=(*|
|00003c00| 2a 28 2a 2a 64 65 76 69 | 63 65 29 2e 67 64 50 4d |*(**devi|ce).gdPM|
|00003c10| 61 70 29 2e 70 6d 54 61 | 62 6c 65 3b 0d 09 63 6f |ap).pmTa|ble;..co|
|00003c20| 6c 6f 72 73 3d 28 2a 63 | 74 29 2d 3e 63 74 53 69 |lors=(*c|t)->ctSi|
|00003c30| 7a 65 2b 31 3b 0d 09 23 | 69 66 20 4d 41 4b 45 5f |ze+1;..#|if MAKE_|
|00003c40| 43 4f 4c 4f 52 5f 54 41 | 42 4c 45 0d 09 09 65 72 |COLOR_TA|BLE...er|
|00003c50| 72 6f 72 3d 48 61 6e 64 | 54 6f 48 61 6e 64 28 28 |ror=Hand|ToHand((|
|00003c60| 48 61 6e 64 6c 65 20 2a | 29 26 63 74 29 3b 0d 09 |Handle *|)&ct);..|
|00003c70| 09 69 66 28 65 72 72 6f | 72 29 50 72 69 6e 74 66 |.if(erro|r)Printf|
|00003c80| 45 78 69 74 28 22 25 73 | 20 6c 69 6e 65 20 25 64 |Exit("%s| line %d|
|00003c90| 3a 20 65 72 72 6f 72 20 | 25 64 20 69 6e 20 63 6f |: error |%d in co|
|00003ca0| 70 79 69 6e 67 20 63 6f | 6c 6f 72 20 74 61 62 6c |pying co|lor tabl|
|00003cb0| 65 5c 6e 22 0d 09 09 09 | 2c 5f 5f 46 49 4c 45 5f |e\n"....|,__FILE_|
|00003cc0| 5f 2c 5f 5f 4c 49 4e 45 | 5f 5f 2c 65 72 72 6f 72 |_,__LINE|__,error|
|00003cd0| 29 3b 0d 09 09 28 2a 63 | 74 29 2d 3e 63 74 46 6c |);...(*c|t)->ctFl|
|00003ce0| 61 67 73 20 26 3d 20 30 | 78 37 66 66 66 3b 09 2f |ags &= 0|x7fff;./|
|00003cf0| 2f 20 63 6c 65 61 72 20 | 22 64 65 76 69 63 65 22 |/ clear |"device"|
|00003d00| 20 62 69 74 0d 09 09 66 | 6f 72 28 69 3d 30 3b 69 | bit...f|or(i=0;i|
|00003d10| 3c 63 6f 6c 6f 72 73 3b | 69 2b 2b 29 20 28 2a 63 |<colors;|i++) (*c|
|00003d20| 74 29 2d 3e 63 74 54 61 | 62 6c 65 5b 69 5d 2e 76 |t)->ctTa|ble[i].v|
|00003d30| 61 6c 75 65 3d 69 3b 0d | 09 09 28 2a 63 74 29 2d |alue=i;.|..(*ct)-|
|00003d40| 3e 63 74 53 65 65 64 3d | 47 65 74 43 54 53 65 65 |>ctSeed=|GetCTSee|
|00003d50| 64 28 29 3b 0d 09 09 28 | 2a 28 28 43 47 72 61 66 |d();...(|*((CGraf|
|00003d60| 50 74 72 29 77 69 6e 64 | 6f 77 29 2d 3e 70 6f 72 |Ptr)wind|ow)->por|
|00003d70| 74 50 69 78 4d 61 70 29 | 2d 3e 70 6d 54 61 62 6c |tPixMap)|->pmTabl|
|00003d80| 65 3d 63 74 3b 0d 09 23 | 65 6e 64 69 66 0d 09 70 |e=ct;..#|endif..p|
|00003d90| 61 6c 65 74 74 65 3d 4e | 65 77 50 61 6c 65 74 74 |alette=N|ewPalett|
|00003da0| 65 28 63 6f 6c 6f 72 73 | 2c 63 74 2c 70 6d 45 78 |e(colors|,ct,pmEx|
|00003db0| 70 6c 69 63 69 74 2b 70 | 6d 54 6f 6c 65 72 61 6e |plicit+p|mToleran|
|00003dc0| 74 2c 30 29 3b 0d 09 53 | 65 74 50 61 6c 65 74 74 |t,0);..S|etPalett|
|00003dd0| 65 28 77 69 6e 64 6f 77 | 2c 70 61 6c 65 74 74 65 |e(window|,palette|
|00003de0| 2c 30 29 3b 0d 7d 0d 0d | 2f 2a 0d 52 65 6d 6f 76 |,0);.}..|/*.Remov|
|00003df0| 65 50 61 6c 65 74 74 65 | 20 6d 61 79 20 6c 6f 6f |ePalette| may loo|
|00003e00| 6b 20 64 61 6e 67 65 72 | 6f 75 73 2e 20 49 20 77 |k danger|ous. I w|
|00003e10| 6f 72 72 69 65 64 20 74 | 68 61 74 20 74 68 65 20 |orried t|hat the |
|00003e20| 57 69 6e 64 6f 77 20 6f | 72 0d 50 61 6c 65 74 74 |Window o|r.Palett|
|00003e30| 65 20 4d 61 6e 61 67 65 | 72 20 6d 69 67 68 74 20 |e Manage|r might |
|00003e40| 62 65 63 6f 6d 65 20 63 | 6f 6e 66 75 73 65 64 20 |become c|onfused |
|00003e50| 69 66 20 69 74 20 6c 61 | 74 65 72 20 74 72 69 65 |if it la|ter trie|
|00003e60| 73 20 74 6f 20 61 63 63 | 65 73 73 20 74 68 65 0d |s to acc|ess the.|
|00003e70| 77 69 6e 64 6f 77 27 73 | 20 70 61 6c 65 74 74 65 |window's| palette|
|00003e80| 2c 20 77 68 69 63 68 20 | 6e 6f 20 6c 6f 6e 67 65 |, which |no longe|
|00003e90| 72 20 65 78 69 73 74 73 | 2e 20 48 6f 77 65 76 65 |r exists|. Howeve|
|00003ea0| 72 2c 20 62 79 20 74 72 | 69 61 6c 20 61 6e 64 20 |r, by tr|ial and |
|00003eb0| 65 72 72 6f 72 0d 49 27 | 76 65 20 66 6f 75 6e 64 |error.I'|ve found|
|00003ec0| 20 74 68 61 74 20 74 68 | 69 73 20 77 6f 72 6b 73 | that th|is works|
|00003ed0| 20 66 69 6e 65 2c 20 61 | 6e 64 20 74 68 61 74 20 | fine, a|nd that |
|00003ee0| 6d 79 20 61 74 74 65 6d | 70 74 73 20 74 6f 20 6d |my attem|pts to m|
|00003ef0| 61 6b 65 20 65 78 70 6c | 69 63 69 74 20 74 68 65 |ake expl|icit the|
|00003f00| 0d 66 61 63 74 20 74 68 | 61 74 20 74 68 65 20 70 |.fact th|at the p|
|00003f10| 61 6c 65 74 74 65 20 69 | 73 20 67 6f 6e 65 2c 20 |alette i|s gone, |
|00003f20| 65 2e 67 2e 20 62 79 20 | 63 61 6c 6c 69 6e 67 20 |e.g. by |calling |
|00003f30| 53 65 74 50 61 6c 65 74 | 74 65 28 77 69 6e 64 6f |SetPalet|te(windo|
|00003f40| 77 2c 4e 55 4c 4c 2c 30 | 29 2c 0d 61 6c 6c 20 70 |w,NULL,0|),.all p|
|00003f50| 72 6f 64 75 63 65 64 20 | 63 72 61 73 68 65 73 2e |roduced |crashes.|
|00003f60| 20 49 20 63 6f 6e 63 6c | 75 64 65 20 74 68 61 74 | I concl|ude that|
|00003f70| 20 74 68 65 20 50 61 6c | 65 74 74 65 20 6f 72 20 | the Pal|ette or |
|00003f80| 57 69 6e 64 6f 77 20 4d | 61 6e 61 67 65 72 20 6d |Window M|anager m|
|00003f90| 6f 6e 69 74 6f 72 73 0d | 74 68 65 20 63 61 6c 6c |onitors.|the call|
|00003fa0| 73 20 74 6f 20 44 69 73 | 70 6f 73 65 50 61 6c 65 |s to Dis|posePale|
|00003fb0| 74 74 65 20 61 6e 64 20 | 74 68 75 73 20 6b 6e 6f |tte and |thus kno|
|00003fc0| 77 73 20 74 68 61 74 20 | 74 68 65 20 70 61 6c 65 |ws that |the pale|
|00003fd0| 74 74 65 20 69 73 20 67 | 6f 6e 65 2e 0d 2a 2f 0d |tte is g|one..*/.|
|00003fe0| 76 6f 69 64 20 52 65 6d | 6f 76 65 50 61 6c 65 74 |void Rem|ovePalet|
|00003ff0| 74 65 28 57 69 6e 64 6f | 77 50 74 72 20 77 69 6e |te(Windo|wPtr win|
|00004000| 64 6f 77 29 0d 7b 0d 09 | 69 66 28 77 69 6e 64 6f |dow).{..|if(windo|
|00004010| 77 3d 3d 4e 55 4c 4c 29 | 72 65 74 75 72 6e 3b 0d |w==NULL)|return;.|
|00004020| 09 44 69 73 70 6f 73 65 | 50 61 6c 65 74 74 65 28 |.Dispose|Palette(|
|00004030| 47 65 74 50 61 6c 65 74 | 74 65 28 77 69 6e 64 6f |GetPalet|te(windo|
|00004040| 77 29 29 3b 0d 7d 0d 0d | 76 6f 69 64 20 53 77 61 |w));.}..|void Swa|
|00004050| 70 57 69 6e 64 6f 77 45 | 78 70 6c 69 63 69 74 4d |pWindowE|xplicitM|
|00004060| 6f 64 65 28 43 57 69 6e | 64 6f 77 50 74 72 20 77 |ode(CWin|dowPtr w|
|00004070| 69 6e 64 6f 77 2c 42 6f | 6f 6c 65 61 6e 20 2a 65 |indow,Bo|olean *e|
|00004080| 78 70 6c 69 63 69 74 29 | 0d 2f 2f 20 47 65 74 20 |xplicit)|.// Get |
|00004090| 61 6e 64 20 73 65 74 20 | 62 69 74 20 31 34 20 6f |and set |bit 14 o|
|000040a0| 66 20 74 68 65 20 63 74 | 46 6c 61 67 73 20 66 69 |f the ct|Flags fi|
|000040b0| 65 6c 64 20 6f 66 20 74 | 68 65 20 77 69 6e 64 6f |eld of t|he windo|
|000040c0| 77 27 73 20 63 6f 6c 6f | 72 20 74 61 62 6c 65 2e |w's colo|r table.|
|000040d0| 0d 2f 2f 20 54 68 69 73 | 20 69 73 20 6f 6e 6c 79 |.// This| is only|
|000040e0| 20 72 65 6c 65 76 61 6e | 74 20 74 6f 20 61 20 43 | relevan|t to a C|
|000040f0| 6f 70 79 42 69 74 73 20 | 66 72 6f 6d 20 61 6e 20 |opyBits |from an |
|00004100| 6f 66 66 73 63 72 65 65 | 6e 0d 2f 2f 20 67 72 61 |offscree|n.// gra|
|00004110| 70 68 69 63 73 20 65 6e | 76 69 72 6f 6e 6d 65 6e |phics en|vironmen|
|00004120| 74 2c 20 62 65 20 69 74 | 20 50 69 78 4d 61 70 20 |t, be it| PixMap |
|00004130| 6f 72 20 47 57 6f 72 6c | 64 2c 20 74 6f 20 61 6e |or GWorl|d, to an|
|00004140| 20 6f 6e 73 63 72 65 65 | 6e 20 77 69 6e 64 6f 77 | onscree|n window|
|00004150| 2e 0d 2f 2f 20 53 65 65 | 20 49 6e 73 69 64 65 20 |..// See| Inside |
|00004160| 4d 61 63 20 56 49 2c 20 | 70 61 67 65 20 32 30 2d |Mac VI, |page 20-|
|00004170| 31 37 2e 20 54 6f 20 67 | 65 74 20 74 68 65 20 66 |17. To g|et the f|
|00004180| 75 6c 6c 20 73 74 6f 72 | 79 20 73 65 65 20 22 43 |ull stor|y see "C|
|00004190| 6f 70 79 42 69 74 73 20 | 73 6c 61 76 69 73 68 6c |opyBits |slavishl|
|000041a0| 79 22 20 69 6e 20 0d 2f | 2f 20 56 69 64 65 6f 54 |y" in ./|/ VideoT|
|000041b0| 6f 6f 6c 62 6f 78 3a 4e | 6f 74 65 73 2e 0d 7b 0d |oolbox:N|otes..{.|
|000041c0| 09 69 6e 74 20 69 2c 6f | 6b 3b 0d 09 43 6f 6c 6f |.int i,o|k;..Colo|
|000041d0| 72 54 61 62 6c 65 20 2a | 2a 63 74 3b 0d 09 42 6f |rTable *|*ct;..Bo|
|000041e0| 6f 6c 65 61 6e 20 6f 6c | 64 45 78 70 6c 69 63 69 |olean ol|dExplici|
|000041f0| 74 3b 0d 0d 09 69 66 28 | 77 69 6e 64 6f 77 3d 3d |t;...if(|window==|
|00004200| 4e 55 4c 4c 29 72 65 74 | 75 72 6e 3b 0d 09 2f 2f |NULL)ret|urn;..//|
|00004210| 20 49 66 20 69 74 27 73 | 20 61 20 47 57 6f 72 6c | If it's| a GWorl|
|00004220| 64 50 74 72 20 74 68 65 | 6e 20 77 65 20 6d 75 73 |dPtr the|n we mus|
|00004230| 74 20 6c 6f 63 6b 20 74 | 68 65 20 70 69 78 65 6c |t lock t|he pixel|
|00004240| 73 20 74 6f 20 61 63 63 | 65 73 73 20 74 68 65 20 |s to acc|ess the |
|00004250| 70 69 78 6d 61 70 2e 0d | 09 69 66 28 28 77 69 6e |pixmap..|.if((win|
|00004260| 64 6f 77 2d 3e 70 6f 72 | 74 56 65 72 73 69 6f 6e |dow->por|tVersion|
|00004270| 26 30 78 63 30 30 31 29 | 3d 3d 30 78 63 30 30 31 |&0xc001)|==0xc001|
|00004280| 29 7b 0d 09 09 6f 6b 3d | 4c 6f 63 6b 50 69 78 65 |){...ok=|LockPixe|
|00004290| 6c 73 28 47 65 74 47 57 | 6f 72 6c 64 50 69 78 4d |ls(GetGW|orldPixM|
|000042a0| 61 70 28 77 69 6e 64 6f | 77 29 29 3b 0d 09 09 69 |ap(windo|w));...i|
|000042b0| 66 28 21 6f 6b 29 72 65 | 74 75 72 6e 3b 0d 09 7d |f(!ok)re|turn;..}|
|000042c0| 0d 09 63 74 3d 28 2a 77 | 69 6e 64 6f 77 2d 3e 70 |..ct=(*w|indow->p|
|000042d0| 6f 72 74 50 69 78 4d 61 | 70 29 2d 3e 70 6d 54 61 |ortPixMa|p)->pmTa|
|000042e0| 62 6c 65 3b 0d 09 6f 6c | 64 45 78 70 6c 69 63 69 |ble;..ol|dExplici|
|000042f0| 74 3d 28 28 2a 63 74 29 | 2d 3e 63 74 46 6c 61 67 |t=((*ct)|->ctFlag|
|00004300| 73 26 30 78 34 30 30 30 | 29 21 3d 30 3b 0d 09 69 |s&0x4000|)!=0;..i|
|00004310| 66 28 2a 65 78 70 6c 69 | 63 69 74 29 7b 0d 09 09 |f(*expli|cit){...|
|00004320| 28 2a 63 74 29 2d 3e 63 | 74 46 6c 61 67 73 7c 3d |(*ct)->c|tFlags|=|
|00004330| 30 78 34 30 30 30 3b 0d | 09 09 66 6f 72 28 69 3d |0x4000;.|..for(i=|
|00004340| 28 2a 63 74 29 2d 3e 63 | 74 53 69 7a 65 3b 69 3e |(*ct)->c|tSize;i>|
|00004350| 3d 30 3b 69 2d 2d 29 28 | 2a 63 74 29 2d 3e 63 74 |=0;i--)(|*ct)->ct|
|00004360| 54 61 62 6c 65 5b 69 5d | 2e 76 61 6c 75 65 3d 69 |Table[i]|.value=i|
|00004370| 3b 0d 09 7d 65 6c 73 65 | 7b 0d 09 09 28 2a 63 74 |;..}else|{...(*ct|
|00004380| 29 2d 3e 63 74 46 6c 61 | 67 73 26 3d 7e 30 78 34 |)->ctFla|gs&=~0x4|
|00004390| 30 30 30 3b 0d 09 7d 0d | 09 2a 65 78 70 6c 69 63 |000;..}.|.*explic|
|000043a0| 69 74 3d 6f 6c 64 45 78 | 70 6c 69 63 69 74 3b 0d |it=oldEx|plicit;.|
|000043b0| 7d 0d 0d 2f 2f 20 43 41 | 55 54 49 4f 4e 3a 20 54 |}..// CA|UTION: T|
|000043c0| 68 65 20 50 69 78 4d 61 | 70 20 68 61 6e 64 6c 65 |he PixMa|p handle|
|000043d0| 73 20 61 72 65 20 6e 6f | 74 20 6c 6f 63 6b 65 64 |s are no|t locked|
|000043e0| 2e 20 53 6f 20 64 6f 6e | 27 74 20 6d 6f 76 65 20 |. So don|'t move |
|000043f0| 6d 65 6d 6f 72 79 2e 20 | 54 68 65 0d 2f 2f 20 72 |memory. |The.// r|
|00004400| 65 74 75 72 6e 65 64 20 | 70 6f 69 6e 74 65 72 73 |eturned |pointers|
|00004410| 20 77 69 6c 6c 20 62 65 | 63 6f 6d 65 20 69 6e 76 | will be|come inv|
|00004420| 61 6c 69 64 20 61 73 20 | 73 6f 6f 6e 20 61 73 20 |alid as |soon as |
|00004430| 79 6f 75 20 63 61 6c 6c | 20 61 6e 79 20 72 6f 75 |you call| any rou|
|00004440| 74 69 6e 65 0d 2f 2f 20 | 74 68 61 74 20 6d 6f 76 |tine.// |that mov|
|00004450| 65 73 20 6d 65 6d 6f 72 | 79 2e 20 43 6f 70 79 42 |es memor|y. CopyB|
|00004460| 69 74 73 20 61 6e 64 20 | 43 6f 70 79 42 69 74 73 |its and |CopyBits|
|00004470| 51 75 69 63 6b 6c 79 20 | 61 72 65 20 6f 6b 2e 0d |Quickly |are ok..|
|00004480| 42 69 74 4d 61 70 20 2a | 47 65 74 42 69 74 4d 61 |BitMap *|GetBitMa|
|00004490| 70 50 74 72 28 43 57 69 | 6e 64 6f 77 50 74 72 20 |pPtr(CWi|ndowPtr |
|000044a0| 77 69 6e 64 6f 77 29 0d | 7b 0d 09 42 69 74 4d 61 |window).|{..BitMa|
|000044b0| 70 20 2a 62 69 74 73 3b | 0d 09 69 6e 74 20 6f 6b |p *bits;|..int ok|
|000044c0| 3b 0d 09 50 69 78 4d 61 | 70 50 74 72 20 2a 70 6d |;..PixMa|pPtr *pm|
|000044d0| 3b 0d 0d 09 69 66 28 49 | 73 47 57 6f 72 6c 64 50 |;...if(I|sGWorldP|
|000044e0| 74 72 28 77 69 6e 64 6f | 77 29 29 7b 0d 09 09 2f |tr(windo|w)){.../|
|000044f0| 2f 20 49 74 27 73 20 61 | 20 47 57 6f 72 6c 64 50 |/ It's a| GWorldP|
|00004500| 74 72 2c 20 6c 6f 63 6b | 20 74 68 65 20 70 69 78 |tr, lock| the pix|
|00004510| 65 6c 73 2c 20 72 65 74 | 75 72 6e 20 70 69 78 6d |els, ret|urn pixm|
|00004520| 61 70 20 70 74 72 2e 0d | 09 09 6f 6b 3d 4c 6f 63 |ap ptr..|..ok=Loc|
|00004530| 6b 50 69 78 65 6c 73 28 | 47 65 74 47 57 6f 72 6c |kPixels(|GetGWorl|
|00004540| 64 50 69 78 4d 61 70 28 | 28 47 57 6f 72 6c 64 50 |dPixMap(|(GWorldP|
|00004550| 74 72 29 77 69 6e 64 6f | 77 29 29 3b 0d 09 09 69 |tr)windo|w));...i|
|00004560| 66 28 21 6f 6b 29 72 65 | 74 75 72 6e 20 4e 55 4c |f(!ok)re|turn NUL|
|00004570| 4c 3b 0d 09 09 70 6d 3d | 47 65 74 47 57 6f 72 6c |L;...pm=|GetGWorl|
|00004580| 64 50 69 78 4d 61 70 28 | 28 47 57 6f 72 6c 64 50 |dPixMap(|(GWorldP|
|00004590| 74 72 29 77 69 6e 64 6f | 77 29 3b 0d 2f 2f 09 09 |tr)windo|w);.//..|
|000045a0| 48 4c 6f 63 6b 28 28 48 | 61 6e 64 6c 65 29 70 6d |HLock((H|andle)pm|
|000045b0| 29 3b 0d 09 09 62 69 74 | 73 20 3d 20 28 42 69 74 |);...bit|s = (Bit|
|000045c0| 4d 61 70 20 2a 29 2a 70 | 6d 3b 0d 09 7d 65 6c 73 |Map *)*p|m;..}els|
|000045d0| 65 20 69 66 28 21 49 73 | 47 72 61 66 50 74 72 28 |e if(!Is|GrafPtr(|
|000045e0| 77 69 6e 64 6f 77 29 29 | 7b 0d 09 09 70 6d 3d 77 |window))|{...pm=w|
|000045f0| 69 6e 64 6f 77 2d 3e 70 | 6f 72 74 50 69 78 4d 61 |indow->p|ortPixMa|
|00004600| 70 3b 0d 2f 2f 09 09 48 | 4c 6f 63 6b 28 28 48 61 |p;.//..H|Lock((Ha|
|00004610| 6e 64 6c 65 29 70 6d 29 | 3b 0d 09 09 62 69 74 73 |ndle)pm)|;...bits|
|00004620| 20 3d 20 28 42 69 74 4d | 61 70 20 2a 29 2a 70 6d | = (BitM|ap *)*pm|
|00004630| 3b 0d 09 7d 65 6c 73 65 | 7b 0d 09 09 62 69 74 73 |;..}else|{...bits|
|00004640| 20 3d 20 26 28 28 57 69 | 6e 64 6f 77 50 74 72 29 | = &((Wi|ndowPtr)|
|00004650| 77 69 6e 64 6f 77 29 2d | 3e 70 6f 72 74 42 69 74 |window)-|>portBit|
|00004660| 73 3b 0d 09 7d 0d 09 72 | 65 74 75 72 6e 20 62 69 |s;..}..r|eturn bi|
|00004670| 74 73 3b 0d 7d 0d 0d 42 | 6f 6f 6c 65 61 6e 20 49 |ts;.}..B|oolean I|
|00004680| 73 47 57 6f 72 6c 64 50 | 74 72 28 43 57 69 6e 64 |sGWorldP|tr(CWind|
|00004690| 6f 77 50 74 72 20 77 69 | 6e 64 6f 77 29 09 2f 2f |owPtr wi|ndow).//|
|000046a0| 20 49 73 20 69 74 20 61 | 20 47 57 6f 72 6c 64 50 | Is it a| GWorldP|
|000046b0| 74 72 3f 0d 7b 0d 09 72 | 65 74 75 72 6e 20 28 77 |tr?.{..r|eturn (w|
|000046c0| 69 6e 64 6f 77 2d 3e 70 | 6f 72 74 56 65 72 73 69 |indow->p|ortVersi|
|000046d0| 6f 6e 26 30 78 63 30 30 | 31 29 20 3d 3d 20 30 78 |on&0xc00|1) == 0x|
|000046e0| 63 30 30 31 3b 0d 7d 0d | 0d 0d 42 6f 6f 6c 65 61 |c001;.}.|..Boolea|
|000046f0| 6e 20 49 73 47 72 61 66 | 50 74 72 28 43 57 69 6e |n IsGraf|Ptr(CWin|
|00004700| 64 6f 77 50 74 72 20 77 | 69 6e 64 6f 77 29 09 2f |dowPtr w|indow)./|
|00004710| 2f 20 49 73 20 69 74 20 | 61 20 57 69 6e 64 6f 77 |/ Is it |a Window|
|00004720| 50 74 72 3f 0d 7b 0d 09 | 72 65 74 75 72 6e 20 77 |Ptr?.{..|return w|
|00004730| 69 6e 64 6f 77 2d 3e 70 | 6f 72 74 56 65 72 73 69 |indow->p|ortVersi|
|00004740| 6f 6e 3e 3d 30 3b 0d 7d | 0d 0d 00 00 00 00 00 00 |on>=0;.}|........|
|00004750| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004760| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004770| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004780| 00 00 01 00 00 00 03 4e | 00 00 02 4e 00 00 00 c2 |.......N|...N....|
|00004790| 44 4c 69 6e 65 61 72 47 | 61 6d 6d 61 28 29 20 61 |DLinearG|amma() a|
|000047a0| 6e 64 20 47 44 53 65 74 | 45 6e 74 72 69 65 73 28 |nd GDSet|Entries(|
|000047b0| 0e 47 44 4f 70 65 6e 57 | 69 6e 64 6f 77 2e 63 47 |.GDOpenW|indow.cG|
|000047c0| 02 00 00 00 50 61 72 74 | 53 49 54 21 00 00 00 00 |....Part|SIT!....|
|000047d0| 00 00 50 61 72 74 53 49 | 54 21 00 00 00 00 00 00 |..PartSI|T!......|
|000047e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000047f0| 00 00 ab bf ee 5d 00 00 | 00 00 00 00 04 10 6f 6c |.....]..|......ol|
|00004800| 6f 72 20 4d 61 6e 61 67 | 65 72 2e 20 53 69 6e 63 |or Manag|er. Sinc|
|00004810| 65 0d 74 68 65 20 43 6f | 6c 6f 72 20 61 6e 64 20 |e.the Co|lor and |
|00004820| 50 61 6c 65 74 74 65 20 | 4d 61 6e 61 67 65 72 73 |Palette |Managers|
|00004830| 20 64 6f 6e 27 74 20 6b | 6e 6f 77 20 74 68 61 74 | don't k|now that|
|00004840| 20 79 6f 75 27 76 65 20 | 63 68 61 6e 67 65 64 20 | you've |changed |
|00004850| 74 68 65 20 63 6f 6c 6f | 72 20 65 6e 76 69 72 6f |the colo|r enviro|
|00004860| 6e 6d 65 6e 74 0d 74 68 | 65 79 20 63 61 6e 27 74 |nment.th|ey can't|
|00004870| 20 72 65 61 63 74 20 74 | 6f 20 69 74 2c 20 61 6e | react t|o it, an|
|00004880| 00 00 00 2a 00 09 06 47 | 65 6e 65 76 61 00 00 00 |...*...G|eneva...|
|00004890| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000048a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000048b0| 00 04 00 06 00 04 00 00 | 00 14 00 00 00 66 00 0e |........|.....f..|
|000048c0| ff f4 00 0c ff ff 00 00 | 35 df 00 00 35 e7 00 00 |........|5...5...|
|000048d0| 00 1e 00 3d 00 04 01 8c | 02 7c 00 3d 00 04 01 8c |...=....|.|.=....|
|000048e0| 02 7c 00 00 3f c3 00 00 | 00 00 00 00 00 00 00 00 |.|..?...|........|
|000048f0| 00 00 00 14 00 00 2d 61 | 00 d4 00 00 00 00 00 00 |......-a|........|
|00004900| 31 00 00 f1 00 00 00 00 | 00 00 00 b8 00 07 00 12 |1.......|........|
|00004910| 00 00 2f a2 00 e9 00 50 | f6 a8 00 00 03 69 64 20 |../....P|.....id |
|00004920| 00 20 00 00 2f 8c 00 e8 | 00 50 f6 98 00 00 11 28 |. ../...|.P.....(|
|00004930| 2a 2a 70 6d 29 2e 70 69 | 78 65 6c 53 69 7a 65 20 |**pm).pi|xelSize |
|00004940| 00 20 00 00 2f b3 00 ea | 00 50 f6 88 00 00 11 28 |. ../...|.P.....(|
|00004950| 2a 2a 74 61 62 6c 65 29 | 2e 63 74 53 65 65 64 20 |**table)|.ctSeed |
|00004960| 00 14 00 00 30 23 00 ec | 00 50 f6 78 00 00 05 74 |....0#..|.P.x...t|
|00004970| 61 62 6c 65 00 26 00 00 | 31 00 00 f1 00 50 f5 68 |able.&..|1....P.h|
|00004980| 80 00 00 46 01 b4 01 1b | 02 7c 94 20 00 00 00 00 |...F....|.|. ....|
|00004990| 00 00 07 2a 2a 74 61 62 | 6c 65 00 16 00 00 31 00 |...**tab|le....1.|
|000049a0| 00 f1 00 50 f5 6c 00 00 | 07 2a 74 61 62 6c 65 20 |...P.l..|.*table |
|000049b0| 00 14 00 00 31 00 00 f1 | 00 50 f5 40 00 00 05 74 |....1...|.P.@...t|
|000049c0| 61 62 6c 65 00 00 00 b2 | 00 07 00 00 21 4d 00 00 |able....|....!M..|
|000049d0| 21 5f 13 41 64 64 45 78 | 70 6c 69 63 69 74 50 61 |!_.AddEx|plicitPa|
|000049e0| 6c 65 74 74 65 00 00 00 | 19 83 00 00 19 92 0f 47 |lette...|.......G|
|000049f0| 44 44 69 73 70 6f 73 65 | 57 69 6e 64 6f 77 00 00 |DDispose|Window..|
|00004a00| 1c 75 00 00 1c 85 11 47 | 44 44 69 73 70 6f 73 65 |.u.....G|DDispose|
|00004a10| 57 69 6e 64 6f 77 31 00 | 00 00 19 08 00 00 19 14 |Window1.|........|
|00004a20| 0d 47 44 4f 70 65 6e 57 | 69 6e 64 6f 77 00 00 00 |.GDOpenW|indow...|
|00004a30| 1a 18 00 00 1a 25 0d 47 | 44 4f 70 65 6e 57 69 6e |.....%.G|DOpenWin|
|00004a40| 64 6f 77 31 00 00 1f 94 | 00 00 1f aa 17 4d 61 6b |dow1....|.....Mak|
|00004a50| 65 43 6f 6c 6f 72 54 61 | 62 6c 65 45 78 70 6c 69 |eColorTa|bleExpli|
|00004a60| 63 69 74 00 00 00 29 f0 | 00 00 29 f7 0d 52 65 6d |cit...).|..)..Rem|
|00004a70| 6f 76 65 50 61 6c 65 74 | 74 65 00 00 00 48 00 09 |ovePalet|te...H..|
|00004a80| 4d 6f 6e 61 63 6f 00 00 | 00 00 00 00 00 00 00 00 |Monaco..|........|
|00004a90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004aa0| 00 03 00 04 00 3d 00 03 | 01 f0 02 7d 00 3d 00 03 |.....=..|...}.=..|
|00004ab0| 01 f0 02 7d ab b0 bc 87 | 00 00 30 f9 00 00 30 f9 |...}....|..0...0.|
|00004ac0| 00 00 2a 9d 00 00 00 00 | 00 04 00 01 00 01 00 00 |..*.....|........|
|00004ad0| 01 00 00 00 03 4e 00 00 | 02 4e 00 00 00 c2 01 c7 |.....N..|.N......|
|00004ae0| 3a 38 26 90 00 00 00 1c | 00 c2 00 06 4d 50 53 52 |:8&.....|....MPSR|
|00004af0| 00 02 00 3a 45 46 4e 54 | 00 00 00 5e 45 54 41 42 |...:EFNT|...^ETAB|
|00004b00| 00 00 00 6a 45 51 45 44 | 00 00 00 76 42 4b 50 54 |...jEQED|...vBKPT|
|00004b10| 00 00 00 82 44 54 56 55 | 00 00 00 8e 4d 57 42 42 |....DTVU|....MWBB|
|00004b20| 00 00 00 9a 03 f0 ff ff | 00 00 00 4e 00 00 00 00 |........|...N....|
|00004b30| 03 ef ff ff 00 00 01 44 | 00 00 00 00 03 ed ff ff |.......D|........|
|00004b40| 00 00 01 fa 00 00 00 00 | 03 eb ff ff 00 00 00 00 |........|........|
|00004b50| 00 00 00 00 03 ec ff ff | 00 00 00 2e 00 00 00 00 |........|........|
|00004b60| 03 eb ff ff 00 00 00 36 | 00 00 00 00 64 65 ff ff |.......6|....de..|
|00004b70| 00 00 00 70 00 00 00 00 | 1a e8 ff ff 00 00 00 88 |...p....|........|
|00004b80| 00 00 00 00 03 f0 ff ff | 00 00 02 46 00 00 00 00 |........|...F....|
|00004b90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004ba0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004bb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004bc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004bd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004be0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004bf0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+